Click here to Skip to main content
15,900,511 members
Home / Discussions / C#
   

C#

 
GeneralRe: PAN card design print application Pin
Richard MacCutchan18-May-17 21:31
mveRichard MacCutchan18-May-17 21:31 
GeneralRe: PAN card design print application Pin
Member 1312346618-May-17 21:42
Member 1312346618-May-17 21:42 
GeneralRe: PAN card design print application Pin
Richard MacCutchan18-May-17 22:11
mveRichard MacCutchan18-May-17 22:11 
Questionredirect URL ouput to listbox Pin
picasso215-May-17 16:03
picasso215-May-17 16:03 
AnswerRe: redirect URL ouput to listbox Pin
Richard MacCutchan15-May-17 20:47
mveRichard MacCutchan15-May-17 20:47 
QuestionFind highest number using for-loops and arrays Pin
Member 1320204015-May-17 8:35
Member 1320204015-May-17 8:35 
GeneralRe: Find highest number using for-loops and arrays Pin
harold aptroot15-May-17 9:13
harold aptroot15-May-17 9:13 
AnswerRe: Find highest number using for-loops and arrays Pin
Richard MacCutchan15-May-17 20:46
mveRichard MacCutchan15-May-17 20:46 
QuestionUTC Time Conversion Pin
milo-xml15-May-17 6:32
professionalmilo-xml15-May-17 6:32 
AnswerRe: UTC Time Conversion Pin
Richard MacCutchan15-May-17 7:56
mveRichard MacCutchan15-May-17 7:56 
GeneralRe: UTC Time Conversion Pin
milo-xml15-May-17 8:00
professionalmilo-xml15-May-17 8:00 
AnswerRe: UTC Time Conversion Pin
Richard Deeming15-May-17 7:58
mveRichard Deeming15-May-17 7:58 
GeneralRe: UTC Time Conversion Pin
milo-xml15-May-17 8:04
professionalmilo-xml15-May-17 8:04 
QuestionProblem in deserializing a JSON object in C# Pin
Farhad Eft15-May-17 3:07
Farhad Eft15-May-17 3:07 
AnswerRe: Problem in deserializing a JSON object in C# Pin
Dave Kreskowiak15-May-17 4:24
mveDave Kreskowiak15-May-17 4:24 
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 ? PinPopular
lmoelleb14-May-17 23:31
lmoelleb14-May-17 23:31 

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.