Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm thinking of how we do JVM memory monitor in a low overhead way in production environment even under busy hour.

Suppose I have two tomcat app server in production, load balance set up behind them. If I can see the jvm memory statistics I can tell load balance to stop sending the request to the server which will encounter OOM issue. Do this make sense? Jconsole or VisualVM eats more performance resourse is not my choice.

share|improve this question
The Java Simon framework might be a look worth. – khmarbaise Apr 19 '12 at 15:26
possible duplicate - stackoverflow.com/questions/242958/best-tools-to-monitor-tomcat – jasonk Apr 19 '12 at 22:20

4 Answers

Use either JSW, which will monitor the JVM for problems locally, or Jolokia. Or both, actually.

share|improve this answer

JMX would be the answer (Jolokia being a JMX interface).

You might want to also look at - http://stackoverflow.com/questions/242958/best-tools-to-monitor-tomcat

share|improve this answer

If monitoring externally, I'd recommend using an OS level monitoring tool such as ps on Unix to give you memory consumption stats and set up process alerts. You can and should use JMX to monitor heap utilization but remember off heap allocations via direct byte buffers or JNI libraries are invisible to JMX heap monitoring and may lead to even more catastrophic failures than OOM.

share|improve this answer

Maybe jvmtop is worth a look for you.

It shows you in a "top-like" manner on a per-jvm basis monitoring metrics like memory consumption, cpu utilization, thread counts etc.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.