This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Performance and the fly likes Shell script for JVM heap size monitoring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Shell script for JVM heap size monitoring" Watch "Shell script for JVM heap size monitoring" New topic
Author

Shell script for JVM heap size monitoring

P B Madhavan
Greenhorn

Joined: Dec 23, 2009
Posts: 5
Hi Guys,

We have a websphere portal application (v6.1) and it is running on AIX.

I require a simple shell script to probe the JVM heap size and echo an error message if the heap size utilization exeeds a threshold.

Thanks in advance, hope someone can help me here, I am not an expert in Unix shell scripting.

regards,

P B Madhavan
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

P B, welcome to Java Ranch!

Are you talking about overall heap size, or about heap usage? Either way, I don't think that such a script will do for you what you think it will. In the former case, heaps tend to increase in size as the app is used, especially with apps such as Java EE application servers. For the latter, once the heap usage reaches a certain amount, a major garbage collection will come along and free a bunch of space. You can observe both of these by hooking up either jconsole or jvisualvm to your Java app.

By the way, what is it that you are really looking for?


JBoss In Action
Andrei Matyas
Greenhorn

Joined: Apr 15, 2007
Posts: 25
hello,
I do not know if jmap command is available on an AIX system. If not may be this link will be usefull: http://www.redbooks.ibm.com/redbooks/pdfs/sg247353.pdf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Shell script for JVM heap size monitoring
 
Similar Threads
Stack Memory
Error Java Heap Space
OutOfMemory Exception. Please Help!
Linux script to call a java program
OutOfMemory in Servlet