Re: Memory Profiler for Heap Analysis
On 13.06.2007 15:09, Moritz Wissenbach wrote:
On Wed, 13 Jun 2007 14:09:31 +0200, Robert Klemme
<shortcutter@googlemail.com> wrote:
this exists, how does it properly calculate sizes? How many levels
does it follow when counting?
Until it hits a cycle?
If it does not?
Well, then all the better: it's a proper tree and at some point you'll
have traversed it completely.
This still does not address the issue of aliasing properly.
How do you count objects that are referenced by multiple other
instances etc.
Add the objects size to both instaces...?
Remember that n is not restricted to 2, could be much higher.
The point you're interested in is the size of a certain object, say A.
The point I am trying to make is that this concept does not exist with
regard to /referenced/ objects. The only size you can reasonably well
detect is the size of the object itself.
You go ahead and look at what other objects it points. Say it points to
object B. Since A points to B, B's size needs to be added to A's size.
It doesn't matter what other objects point to B, for it will always be
referenced from A, thus, is part of A no matter what.
On the other hand: I'm looking for things to REMOVE from the program.
So, if you would remove A in the above scenario, B would still remain in
memory, so it would be misleading.
Oh well. If we continue discussing, we could as well implement it. Are
you in ? ;)
LOL - no.
DOM is a good candidate. If I were you, I'd create an application
object model, throw away the DOM parsing and create a SAX parser which
directly creates the model. Just my 0.02 EUR...
I think the things we want to achieve (online validation for example) do
require a DOM...
If it is a general XML editor then yes, maybe. If you are editing a
specific XML format, then no.
It's just frustrating. I have the heap dump in front of my eyes, I can
see all the classes of the DOM, still I can't figure out just how much
of the memory they cost in total.
Did you try the memory profiler from Eclipse's TPTP? How did it go?
Kind regards
robert