File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes Monitor JAVA Heap size runtime. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Monitor JAVA Heap size runtime." Watch "Monitor JAVA Heap size runtime." New topic

Monitor JAVA Heap size runtime.

amolJava badgujar

Joined: Apr 24, 2012
Posts: 1
Hi ,

I am running performance test on my server, where it is fialing due to out of memory error.
To analyze the same can any one please suggest me utility/tool which can monitor the JAVA heap activities(size) on run-time basis.

Server is running on Window OS.

Thanks for your reply.
Chris Hurst
Ranch Hand

Joined: Oct 26, 2003
Posts: 443

Depends of if you want this live (alerting ?) or for dev purposes (stop the problem)...

Start with Visual VM (in the JDK) see if that gives you what you want, are you trying to debug the problem or alert in some way. You can use visual VM to connect live to your process (request GC etc) but its not without cost. If you want more detailed info come back ...

For debug : First steps to debug are turn on gc logs and heap dump on out of memory error (java command line), then you'll get a hprof on out of memory and load it into Eclipse MAT and / or Visual VM.

Monitoring the gc logs with a visualizer can be good for alerting of issues and to debugging problems live with no impact on the process.

"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
Myyron Murray Latorilla
Ranch Hand

Joined: Dec 10, 2009
Posts: 65

i use jconsole for monitoring heap

Chris Hurst
Ranch Hand

Joined: Oct 26, 2003
Posts: 443

Visual VM is the Java 6 replacement for Jconsole so unless your on Java 5 use Visual VM ... and if you are on Java 5 move to 6 ;-)
I agree. Here's the link:
subject: Monitor JAVA Heap size runtime.
It's not a secret anymore!