Tracking a memory leak.

B

Bruce Wood

I think that the root of your misunderstanding (pardon the pun) is
that you seem to think that objects are garbage collected if they are
"marked for collection"...

Not true, and I don't see how you got that from my argument either.

Well, it was the only conclusion I could think of. Perhaps it's my
poor imagination. :)

You said that Nicholas was implying that "the initial sweep starts in
the topmost node of a tree." In fact, if there is no way to get from
the stack / static variable / etc to any part of the tree, then the
mark phase ("initial sweep") doesn't start anywhere in the tree. It
never sees the tree, which is what makes the tree eligible for
collection.

If the topmost node of the tree is the only object in the tree
referenced by anything outside the tree, and it is in fact referenced
by an object that is marked as not eligible for collection, then yes
the mark phase ("initial sweep") will traverse the tree starting at
the topmost node, because that's the first object reachable from the
collection of objects that has so far been marked as ineligible for
collection.

Anyway, everything that Nicholas has said so far has been accurate.
I'm trying to figure out where the disagreement is, and not having
much luck. :-(
 
B

Bill Butler

Alvin Bruney said:
I think that the root of your misunderstanding (pardon the pun) is
that you seem to think that objects are garbage collected if they are
"marked for collection"...

Not true, and I don't see how you got that from my argument either.

That's the statement that made me think you misunderstood the process.
Since, as Bruce explains, if the root node is visited, it means that the
tree is NOT eligible for garbage collection.

Bill
 
B

bob

I have an object tree that is pretty gigantic and it holds about 100mb
of data. When I set the top object to null, I expect that the .NET
framework will clean up the memory at some point. However, I am looking
at the Task Manager and I don't see the MemUsage column decreasing even
after an hour or two. I know that TaskManager may not be the best place
to see what is the true way to gauge memory usage and/or presense of
memory leaks. So I am looking for a pointer on what I should use to see
whether setting an object to null really will at some point free up memory.

Regards

Hi,
This may sound dumb but is there a problem?
I recently watched an app which was suspected of a memory leak.
(The app runs 24/7)
The priv bytes and working set climbed in a series of plateaus over a
a number of hours. My initial reaction was 'memory leak' but it
finally stabilised after about a day. This did not fit the perceived
operational model of the application.
Closing the application reduced the two counters but did not
immediately send them to zero.
I didn't have time to see how long it would take to zero them.

Restarting put the counters back at the start of their plateau climb
and the pattern was roughly repeated.

regards
Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top