Click here to Skip to main content
15,918,211 members
Home / Discussions / C#
   

C#

 
AnswerRe: memory exception Pin
Martin#27-Aug-07 22:25
Martin#27-Aug-07 22:25 
AnswerRe: memory exception Pin
Vasudevan Deepak Kumar27-Aug-07 22:28
Vasudevan Deepak Kumar27-Aug-07 22:28 
AnswerRe: memory exception Pin
Rudolf Jan28-Aug-07 9:05
Rudolf Jan28-Aug-07 9:05 
QuestionSorted List and Garbage Collector Pin
JoZ CaVaLLo27-Aug-07 21:14
JoZ CaVaLLo27-Aug-07 21:14 
AnswerRe: Sorted List and Garbage Collector Pin
Martin#27-Aug-07 22:20
Martin#27-Aug-07 22:20 
GeneralRe: Sorted List and Garbage Collector Pin
Luc Pattyn28-Aug-07 0:54
sitebuilderLuc Pattyn28-Aug-07 0:54 
GeneralRe: Sorted List and Garbage Collector Pin
Martin#28-Aug-07 1:01
Martin#28-Aug-07 1:01 
AnswerRe: Sorted List and Garbage Collector Pin
Luc Pattyn28-Aug-07 0:59
sitebuilderLuc Pattyn28-Aug-07 0:59 
Hi Joz,

The GC runs when it needs to run, i.e. when your process needs free memory
(because you are creating a new object, typically with the "new" keyword)
and the OS does not give it more memory, so it has to go and look if anything
it holds can be thrown out. The execution of the GC is not periodic, and
is not invoked by closing a scope (as in returning from a method).

A SortedList is not threated any different by the GC than any other object.

A SortedList item will be garbage collectable as soon as no references to it
exist any longer.

An item in a SortedList will be garbage collectables as soon as the reference
to it inside the SortedList becomes the last reference AND the
SortedList becomes collectable.

"garbage collectable" means the next time GC runs it will be able to collect
the object (i.e. actually collecting it, or putting it on the finalizing list,
which is handled by a separate GC thread).

SortedList does not implement IDisposable, the code snippet using (... SortedList)
will not compile, because SortedList does not implement IDisposable.

Hope this helps.


Luc Pattyn [Forum Guidelines] [My Articles]


this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google


Questionpicture viewer?? Pin
jith - iii27-Aug-07 21:14
jith - iii27-Aug-07 21:14 
AnswerRe: picture viewer?? Pin
Christian Graus27-Aug-07 21:19
protectorChristian Graus27-Aug-07 21:19 
GeneralRe: picture viewer?? [modified] Pin
jith - iii27-Aug-07 22:07
jith - iii27-Aug-07 22:07 
AnswerRe: picture viewer?? Pin
Vasudevan Deepak Kumar27-Aug-07 22:50
Vasudevan Deepak Kumar27-Aug-07 22:50 
GeneralRe: picture viewer?? Pin
jith - iii27-Aug-07 23:54
jith - iii27-Aug-07 23:54 
AnswerGot solution............ Pin
jith - iii27-Aug-07 23:49
jith - iii27-Aug-07 23:49 
Questionneed a custom textbox... Pin
TheCardinal27-Aug-07 20:54
TheCardinal27-Aug-07 20:54 
AnswerRe: need a custom textbox... Pin
JoZ CaVaLLo27-Aug-07 21:17
JoZ CaVaLLo27-Aug-07 21:17 
Questioninternal and internal protected Pin
Sonia Gupta27-Aug-07 19:28
Sonia Gupta27-Aug-07 19:28 
AnswerRe: internal and internal protected Pin
NaNg1524127-Aug-07 19:45
NaNg1524127-Aug-07 19:45 
GeneralRe: internal and internal protected Pin
Sonia Gupta27-Aug-07 19:50
Sonia Gupta27-Aug-07 19:50 
GeneralRe: internal and internal protected Pin
NaNg1524127-Aug-07 19:59
NaNg1524127-Aug-07 19:59 
GeneralRe: internal and internal protected Pin
NaNg1524127-Aug-07 20:07
NaNg1524127-Aug-07 20:07 
AnswerRe: internal and internal protected Pin
Vikram A Punathambekar27-Aug-07 19:46
Vikram A Punathambekar27-Aug-07 19:46 
GeneralRe: internal and internal protected Pin
Sonia Gupta27-Aug-07 19:51
Sonia Gupta27-Aug-07 19:51 
Questionwebhosting Pin
kalyan_241627-Aug-07 19:19
kalyan_241627-Aug-07 19:19 
AnswerRe: webhosting Pin
Vasudevan Deepak Kumar27-Aug-07 23:22
Vasudevan Deepak Kumar27-Aug-07 23:22 

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.