aspose file tools*
The moose likes Java in General and the fly likes Track Heap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Track Heap" Watch "Track Heap" New topic
Author

Track Heap

yusuf Kaplan
Ranch Hand

Joined: Mar 11, 2011
Posts: 58
Hi all,

all the discussions in this forum regarding Heap and GC isn't there a tool where you can watch the objects in the heap in real time?
I think of a possibility like start debugging your programm and as you step in your debugger one step forward the monitoring tool refreshes his view immediately.
Im not sure whether you can do this with jconsole or visualvm. I think there you must dump a heap and then analyze this dump...

Cheers,
Y
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40


Many profilers -- particularly the commercial ones -- allows you to see the heap. The JVM also allows you to do a HPROF dump -- either on request (control-c) or automatically (out of memory) -- that can be analyzed by various tools.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Henry Wong wrote:
Many profilers -- particularly the commercial ones -- allows you to see the heap. The JVM also allows you to do a HPROF dump -- either on request (control-c) or automatically (out of memory) -- that can be analyzed by various tools.

Henry


Jprofiler is the one I use most of the time. The jhat heap dumps allow you to run host the dump files on a server and analyze them using a SQL like DSL.

These tools are pretty advanced for a SCJP certification however. It is easier to track objects with a pencil and paper. You dont get profilers on the real exam


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
yusuf Kaplan
Ranch Hand

Joined: Mar 11, 2011
Posts: 58
Deepak Bala wrote:These tools are pretty advanced for a SCJP certification however. It is easier to track objects with a pencil and paper. You dont get profilers on the real exam


Sure, but it would be smart to track the current objects in the heap in order to understand some of the mock exam questions...
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

yusuf Kaplan wrote:
Deepak Bala wrote:These tools are pretty advanced for a SCJP certification however. It is easier to track objects with a pencil and paper. You dont get profilers on the real exam


Sure, but it would be smart to track the current objects in the heap in order to understand some of the mock exam questions...


The steps you would have to take to track the same can get complex (Speaking in relative terms to the knowledge necessary for SCJP). But it is undeniably a good skill to have.

Good luck
Javin Paul
Ranch Hand

Joined: Oct 15, 2010
Posts: 281

you might want to learn more about profiling a java application. try netbeans profiler or Jprofiler you will learn more than just watching how many objects are in heap e.g. how many threads are there how they are working etc.


http://javarevisited.blogspot.com - java classpath - Java67 - java hashmap - java logging tips java interview questions Java Enum Tutorial
Rahul Sudip Bose
Ranch Hand

Joined: Jan 21, 2011
Posts: 637

Can anyone provide a list of all the free/open-source tools for this besides jhat ? I thought i will try them.


SCJP 6. Learning more now.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14269
    
  21

Check out JVisualVM, which is included with Oracle's JDK. Run it by entering the command jvisualvm in a command prompt window.

It's a nice tool that you can use to see what your Java programs are doing, and it also contains a profiler.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
 
subject: Track Heap