analysis of memory issue
EDIT -- so looked at Cache#15 and MemoryStore#9 in JVisualVM. Turns out it is the query cache. Hopefully dropping a cache configuration in conf that limits the query cache to less than 10k items (开发者_如何学Pythonthe default) will solve this...
We have a Grails application (v1.2.0) deployed on tomcat 6x. Experienced an OOM crash. Got the heap dump and started analyzing it in JVisualVM. This is what I am seeing
and this
so lots of ehcache stuff, and definitely lots of byte and char arrays. I have tried googling around 'grails memory leak ehcache' but nothing definitive is coming up. Has anyone seen any issues like this or have any insights into what can be causing this? Could it be a misconfigured ehcache?
We are using various plugins(acegi, quartz, mail, background-thread), all the the latest versions FOR grails version 1.2.0.
EDIT - some more info
starting tomcat with the following
-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xms1024m -Xmx2048m -XX:MaxPermSize=256m -d64 -server -XX:+HeapDumpOnOutOfMemoryError -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+UseConcMarkSweepGC
and the error is
java.lang.OutOfMemoryError: Java heap space
Interestingly, we used to get perm gen space related errors, but when i updated to the Java configuration shown above, the permgen space errors went away.
It is normal to have lots of strings and char[]'s. I would try to correct the ehcache configuration... obviously you cache to much. There are options that dump the cache to the disk, maybe this is solution for you.
EDIT: The PermGen goes away because of -XX:MaxPermSize=256m
, which is pretty much.
You could be running out of perm space, not heap.
Log your GC to a file and link, and post back your JVM args.
Are you using Grails 1.2.0 or 1.2.5 (latest 1.2.x)? Newest stable is 1.3.6.. I assume the problem is misconfigured ehcache though.
精彩评论