简体   繁体   中英

Strange Behaviour of Garbage Collector on Tomcat

we have a really strange behaviour with one of our apps running on a Tomcat 7 (with Java 1.6)

The app runs really good for some days, then we see a peak in the Garbage Collector Time, the CPU Usage is more than 10 times of he normal load and the memory isn't freed anymore:

已用记忆体

The last drop was a restart of the app so the performance gets better. as you can see in the graph the space which is freed by the GC gets lower and lower at each run and at the end it isn't going to free any memory, so the performance of the app goes really low.

how can this behaviour be improved?

This looks like a memory leak - if the GC can't free the memory any more, it is most probably due to some code retaining references to unused objects. You should try to track the objects remaining in memory (that graphic tool of yours should have some way to peek into the heap memory regions and give you information on created objects) and make sure you erase any reference to unused objects so the GC can free them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM