Click here to Skip to main content
15,910,471 members
Home / Discussions / C#
   

C#

 
QuestionRe: memory allocated on heap in method Pin
Eddy Vluggen29-Jan-09 2:22
professionalEddy Vluggen29-Jan-09 2:22 
AnswerRe: memory allocated on heap in method Pin
devvvy29-Jan-09 2:27
devvvy29-Jan-09 2:27 
AnswerRe: memory allocated on heap in method Pin
Eddy Vluggen29-Jan-09 2:33
professionalEddy Vluggen29-Jan-09 2:33 
GeneralRe: memory allocated on heap in method Pin
S. Senthil Kumar29-Jan-09 3:04
S. Senthil Kumar29-Jan-09 3:04 
AnswerRe: memory allocated on heap in method Pin
Guffa29-Jan-09 5:21
Guffa29-Jan-09 5:21 
AnswerRe: memory allocated on heap in method [modified] Pin
Luc Pattyn29-Jan-09 5:30
sitebuilderLuc Pattyn29-Jan-09 5:30 
GeneralRe: memory allocated on heap in method Pin
N a v a n e e t h29-Jan-09 5:51
N a v a n e e t h29-Jan-09 5:51 
AnswerRe: memory allocated on heap in method Pin
Luc Pattyn29-Jan-09 8:54
sitebuilderLuc Pattyn29-Jan-09 8:54 
N a v a n e e t h wrote:
setting null will not make any difference for garbage collection


yes it does. The GC looks for references "everywhere" while performing its "mark pass" (assuming a simple "mark and sweep" type GC). Every time you remove a last reference somewhere (e.g. by writing null over it), you make the referred object collectible (i.e. it no longer gets marked as "in use", so the sweep pass will destroy it). The GC is *not* analyzing your code to predict whether an object will still be used in the future, it only determines "reachability", i.e. the theoretical possibility to access it again, based on the data structures only.

In the meantime I have developed a little app that demonstrates exactly how the GC works. When I find
the time, I will write a short article on the subject.
Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


GeneralRe: memory allocated on heap in method Pin
N a v a n e e t h29-Jan-09 15:44
N a v a n e e t h29-Jan-09 15:44 
AnswerRe: memory allocated on heap in method Pin
Luc Pattyn29-Jan-09 15:52
sitebuilderLuc Pattyn29-Jan-09 15:52 
Questionhow to vertically scan an image in c# Pin
Swati Khanna29-Jan-09 1:58
Swati Khanna29-Jan-09 1:58 
AnswerRe: how to vertically scan an image in c# Pin
musefan29-Jan-09 1:59
musefan29-Jan-09 1:59 
GeneralRe: how to vertically scan an image in c# Pin
Swati Khanna29-Jan-09 2:02
Swati Khanna29-Jan-09 2:02 
GeneralRe: how to vertically scan an image in c# Pin
musefan29-Jan-09 2:03
musefan29-Jan-09 2:03 
GeneralRe: how to vertically scan an image in c# Pin
Swati Khanna29-Jan-09 2:08
Swati Khanna29-Jan-09 2:08 
GeneralRe: how to vertically scan an image in c# Pin
musefan29-Jan-09 2:13
musefan29-Jan-09 2:13 
GeneralRe: how to vertically scan an image in c# Pin
Eddy Vluggen29-Jan-09 2:21
professionalEddy Vluggen29-Jan-09 2:21 
GeneralRe: how to vertically scan an image in c# Pin
musefan29-Jan-09 2:30
musefan29-Jan-09 2:30 
GeneralRe: how to vertically scan an image in c# Pin
Swati Khanna29-Jan-09 2:35
Swati Khanna29-Jan-09 2:35 
Questionstacking of 2d images Pin
Nettai29-Jan-09 1:15
Nettai29-Jan-09 1:15 
AnswerRe: stacking of 2d images Pin
musefan29-Jan-09 1:33
musefan29-Jan-09 1:33 
GeneralRe: stacking of 2d images Pin
Nettai29-Jan-09 1:49
Nettai29-Jan-09 1:49 
GeneralRe: stacking of 2d images Pin
musefan29-Jan-09 1:56
musefan29-Jan-09 1:56 
AnswerRe: stacking of 2d images Pin
harold aptroot29-Jan-09 1:45
harold aptroot29-Jan-09 1:45 
AnswerRe: stacking of 2d images Pin
riced29-Jan-09 3:25
riced29-Jan-09 3:25 

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.