Click here to Skip to main content
15,888,106 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem in deserializing a JSON object in C# Pin
Richard MacCutchan15-May-17 5:54
mveRichard MacCutchan15-May-17 5:54 
GeneralRe: Problem in deserializing a JSON object in C# Pin
Richard Deeming15-May-17 7:48
mveRichard Deeming15-May-17 7:48 
GeneralRe: Problem in deserializing a JSON object in C# Pin
Richard MacCutchan15-May-17 7:55
mveRichard MacCutchan15-May-17 7:55 
GeneralRe: Problem in deserializing a JSON object in C# Pin
Richard Deeming15-May-17 7:59
mveRichard Deeming15-May-17 7:59 
AnswerRe: Problem in deserializing a JSON object in C# Pin
Richard Deeming15-May-17 7:52
mveRichard Deeming15-May-17 7:52 
GeneralRe: Problem in deserializing a JSON object in C# Pin
Farhad Eft16-May-17 20:21
Farhad Eft16-May-17 20:21 
QuestionC# hierarchical data structure and .NET garbage collection ? Pin
BillWoodruff14-May-17 14:40
professionalBillWoodruff14-May-17 14:40 
AnswerRe: C# hierarchical data structure and .NET garbage collection ? Pin
Luc Pattyn14-May-17 15:25
sitebuilderLuc Pattyn14-May-17 15:25 
Hi Bill,

1. an object is dead and collectable as soon as you no longer have a reachable reference to it (reachables are inside other obects that are reachable, stacks, static variables, ...). When a number of objects have internal references to each other but no outside references are alive, then all of those objects are dead/collectable.

2. exactly when they get garbage collected is more complex, it depends on the size, the generation number, when your GC runs, etc. However one normally should not care about this, that is the GC's job.

3. when your objects have a Dispose() method (necessary when they may hold pointers to unmanaged system resources), then for each of them the Dispose() method will be called eventually by the GC. In this case it is advisable to call their Dispose() explicitly so the system resources get released ASAP.
Note: providing a Dispose() method will somewhat postpone the GC freeing their memory, so providing a Dispose() on huge objects is a bad idea!

4. when your Application terminates neither of those mechanisms will work for you; instead Windows itself will reclaim all memory and all system resources your program was using (unless...), so you can't safely implement wanted side effects in your Dispose() method as your program might terminate before Dispose() gets called by the GC!


Hope this helps and is sufficiently clear and accurate.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum


modified 15-May-17 5:43am.

GeneralRe: C# hierarchical data structure and .NET garbage collection ? Pin
BillWoodruff14-May-17 20:44
professionalBillWoodruff14-May-17 20:44 
GeneralRe: C# hierarchical data structure and .NET garbage collection ? Pin
lmoelleb14-May-17 23:31
lmoelleb14-May-17 23:31 
GeneralRe: C# hierarchical data structure and .NET garbage collection ? Pin
Luc Pattyn14-May-17 23:40
sitebuilderLuc Pattyn14-May-17 23:40 
GeneralRe: C# hierarchical data structure and .NET garbage collection ? Pin
Pete O'Hanlon14-May-17 23:55
mvePete O'Hanlon14-May-17 23:55 
GeneralRe: C# hierarchical data structure and .NET garbage collection ? Pin
BillWoodruff15-May-17 5:40
professionalBillWoodruff15-May-17 5:40 
GeneralRe: C# hierarchical data structure and .NET garbage collection ? Pin
OriginalGriff15-May-17 6:12
mveOriginalGriff15-May-17 6:12 
AnswerRe: C# hierarchical data structure and .NET garbage collection ? Pin
kalberts23-May-17 22:38
kalberts23-May-17 22:38 
QuestionHelp my C# Pin
Arman Petrosyan12-May-17 9:27
Arman Petrosyan12-May-17 9:27 
AnswerRe: Help my C# Pin
NotPolitcallyCorrect12-May-17 9:48
NotPolitcallyCorrect12-May-17 9:48 
AnswerRe: Help my C# Pin
Patrice T12-May-17 15:17
mvePatrice T12-May-17 15:17 
QuestionHow should i do tracing in c# using zipkin Pin
yeswanthkumar11-May-17 19:18
yeswanthkumar11-May-17 19:18 
AnswerRe: How should i do tracing in c# using zipkin Pin
Chris Quinn11-May-17 20:57
Chris Quinn11-May-17 20:57 
GeneralRe: How should i do tracing in c# using zipkin Pin
yeswanthkumar11-May-17 21:05
yeswanthkumar11-May-17 21:05 
AnswerRe: How should i do tracing in c# using zipkin Pin
Pete O'Hanlon11-May-17 21:08
mvePete O'Hanlon11-May-17 21:08 
AnswerRe: How should i do tracing in c# using zipkin Pin
Gerry Schmitz12-May-17 8:42
mveGerry Schmitz12-May-17 8:42 
QuestionHow to Transfer xml file from remote server to another Pin
Member 1265997911-May-17 0:16
Member 1265997911-May-17 0:16 
QuestionRe: How to Transfer xml file from remote server to another Pin
Richard MacCutchan11-May-17 0:39
mveRichard MacCutchan11-May-17 0:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.