Perhaps this will help you find the cause of your problem.
I have JMX enabled on tomcat (set these additional vm arguments when starting tomcat) -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port = 30188 (any port you want to run jmx for tc) -Dcom .sun.management.jmxremote.ssl = false -Dcom.sun.management.jmxremote.authenticate = false
Then I wrote a small application that tracks memory usage (via jmx) and notifies me of memory usage, say 80%.
Then I would find out as soon as something begins to do wrong. Then I will get a histogram for objects with memory (see http://java.sun.com/javase/6/docs/technotes/tools/share/jmap.html for obtaining).
In the end, it turned out that one of my ejbQL queries caused the use of a huge amount of memory.
Hope this can help in some way ......
source share