File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Track Heap

 
yusuf Kaplan
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 20831
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
yusuf Kaplan
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 295
Eclipse IDE Firefox Browser Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rahul Sudip Bose
Ranch Hand
Posts: 637
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone provide a list of all the free/open-source tools for this besides jhat ? I thought i will try them.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic