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

Monitoring JVM memory

saidi Bandi
Ranch Hand

Joined: Apr 07, 2007
Posts: 64

please could you tell me how to monitor the JVM memory useage on UNIX environment.

Thanking you in advance.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15080

JDK 6 comes with a useful tool, VisualVM. You can start it by running the command jvisualvm, and you can use it to connect to running Java virtual machines and see all kinds of things, like the amount of memory being used, how many threads there are and if they're running or not etc.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
saidi Bandi
Ranch Hand

Joined: Apr 07, 2007
Posts: 64
Hi Young,

Thanks for the reply, but here we are using JDK1.4 version, for that is there any commands to check.

thanking you in advance.
Fred Muhlenberg
Ranch Hand

Joined: Jan 08, 2008
Posts: 39
You can use the JVM command for verbose GC: -verbose:gc
This will output (to standard out) ongoing garbage collection (memory) information with a timestamp so you can get a profile of what memory is being reclaimed and when.

There are some undocumented -XX JVM options available that can help.

I agree. Here's the link:
subject: Monitoring JVM memory
jQuery in Action, 3rd edition