1

One of our production Tomcat boxes runs two webapps. One is ours, another is a black box app that our vendor supplied to "help" with our app.

We are, unfortunately bumping up against memory limits on our production box, and I'm working to add RAM and have Tomcat start with more memory available for the JVM. Before I do this, however, I'd like to see which of these two webapps is eating up all the RAM!

Is there an option within the built-in Tomcat manager that shows RAM usage by webapp? If not, is there a free solution available, somewhere, that offers this level of diagnostic availability?

If need be, I am open to writing my own lightweight webapp to do it, and have one running on the machine that watches the other two.

Thanks,
IVR Avenger

6 Answers 6

1

Take a look at Tcat Server from MuleSoft, it can provide you tons of information on memory utilization. You can use it with your existing Tomcat installation.

1

Try using JMX. Enabling this should be as simple as adding the following line to your startup script:

JAVA_OPTS=$JAVA_OPTS:"-Dcom.sun.management.jmxremote.port=8090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

As you can see, there are options for encryption and authentication to satiate your local Manager of Paranoia.

You didn't mention what monitoring system you're using; you'll probably have to set that up to be able to talk JMX as well. Zabbix has Zapcat, Here's some OpenNMS instructions, and here's a Nagios plugin.

0

Unfortunately, I don't think there is any way to break down RAM usage by individual web application, even using JMX. However, just for this experiment, you could try running each web application in its own Tomcat instance. Then measure the memory usage of each separate JVM.

0

Have a look at lamdaprobe it's a small webapp that can even hook to JMX and give you lot of valuable infos: http://www.devx.com/Java/Article/35659/1954

beware that access to this app should be given only to administrators

0

Zenoss will let you watch the server running tomcat, the tomcat process and monitor it via JMX as well. There's a fair amount of documentation and it's open source.

0

You can break down the memory inside the server by classes and by references, but it is a bit technical. Just take a heap dump at some point in time with jmap or jconsole or jvisualvm or -XX:+HeapDumpOnOutOfMemoryError. Then open it with Eclipse MAT or JHat.

Then if you want more monitoring : http://javamelody.googlecode.com (memory charts and breakdown by classes included)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .