Tomcat web application thread dump

I have a production web application (Struts, iBatis, Hibernate) that works in Tomcat, which freezes during request processing after 6-7 days of work, but after the dump is done, the thread will work fine again.

It’s hard for me to understand why this is so.

I'm just curious if anyone else came across something similar.

+4
source share
2 answers

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 ......

+2
source

First of all, try to reproduce this in a test environment. You can use JMeter , to emphasize the application. You can start tomcat with -verbose: gc and -XX: + PrintGCDetails , which will give you more information about what happens while the GC is running. Then, when the site is not responding, you can get a dump of the stream, and if this site is unlocked, see the details of the GC for more information.

+1
source

Source: https://habr.com/ru/post/1301545/


All Articles