I'm running some Rails applications on Jboss with JRuby.

Sometimes the Java garbage collector can't free memory and the jvm consume all the available memory.

I'm trying to create a custom metric with jstat, but can't figure out some valuable stats that allows me to detect some risky condition and take some action on the server before Java crash.

When all the memory on the jvm is used, one core of the server stay at full capacity trying to collect and free some memory.

Do you have an idea of how can I detect when the GC is about to fail ?



Connect to the application using Java Mission Control and either do a manual recording or set up a memory trigger. The user guide for mission control is at http://docs.oracle.com/javacomponents/jmc-5-5/jmc-user-guide/index.html and http://docs.oracle.com/javacomponents/jmc-5-5/jfr-runtime-guide/index.html

You can also use the template manager to record all garbage collection activity. That way you can see allocation data in terms of where the code is making objects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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