wood burning stoves 2.0*
The moose likes Java in General and the fly likes Visualization of  Heap Memory In java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Visualization of  Heap Memory In java" Watch "Visualization of  Heap Memory In java" New topic
Author

Visualization of Heap Memory In java

Rajesh Tarte
Ranch Hand

Joined: Nov 02, 2006
Posts: 33

Is there any way to see how many objects are created in/on Heap memory in java


SCJP 1.5 | SCWCD 5.0 |SCBCD
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

The JVM has APIs for debugging and profiling, and the current version of Sun Java 6 includes a nice tool called JVisualVM which can show you a lot of information about what's happening in running Java programs. It can show exactly how much memory running Java programs are using, for example. I don't know if it can show exactly how many objects of what types are created, but maybe it can. You should be able to start this tool by typing in "jvisualvm" in a command prompt window.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Rajesh Tarte
Ranch Hand

Joined: Nov 02, 2006
Posts: 33

Does same kind of functionality available in 1.5

Thanks
Ashutosh Gawande
Greenhorn

Joined: Aug 19, 2009
Posts: 11
Hi,

You can use Jmap for creating the memory dump by providing the process id for java process which is running your program and then you can use eclipse memory analyser tool/plug-in to analyse the memory dump.
This will give you all the details you are looking for. But you will need to have patience in analysing dump and need to understand how to spot an issue.

Regards,
Ashutosh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Visualization of Heap Memory In java
 
Similar Threads
Limit of Memory size
JVM memory management
OutOfMemoryError while Retrieving data
Declaration difference
BufferedReader input file size limit