|finding the size of a single object (& more) [message #2211]
||Sat, 28 June 2008 14:10
Originally posted by: am.israel.chay.gmail.com|
1. can i find with this tool, the size of a single object?
2. i am calling to a dll via JNI. both the dll and the java take handreds
can the Memory Analyzer show me how many MB the dll took, and how many the
3. what is the effect of runnnig with Memory Analyzer on the application
4. is the Memory Analyzer useful only when the application crashes on "Out
of memory error", or it can show me the status of the application by
demand (like mini profiler)?
|Re: finding the size of a single object (& more) [message #2241 is a reply to message #2211]
||Sun, 29 June 2008 07:51
| Andreas Buchen
Registered: July 2009
add 1. The Memory Analyzer gives you both sizes: the shallow size (e.g.
space consumed by the member attributes) and the retained size (e.g. the
space consumed by all objects that would be garbage collected if all
references to the object in question were removed).
add 2. The Memory Analyzer works with Java heap dumps. So there is not
much we can say about the memory consumption of native components such as
DLLs. What could be of interest are objects which cannot be garbage
collected because they are used/referenced by native components. These are
objects which are marked as Garbage Collection (GC) roots "JNI Local" and
add 3. As the Memory Analyzer works with heap dumps, the actual analysis
is offline. However, writing the heap dump takes some time. As a rule of
thumb, I am usually calculating with 1 GB heap per minute. Taking this
into account, one would not dump the heap regularly. But if you are
analyzing/investigating a specific problem, it often is worth dump the
heap of one node in a JEE cluster.
add 4. As I just mentioned, one can get a heap dump on out Of memory. It
really depends on your operation system and the Java version you are
using. Check our WIKI pages. The easiest thing for me is using Java 6 and
running JConsole to get a heap dump.
Powered by FUDForum
. Page generated in 0.13699 seconds