Is there any way to prevent Grails from leaking to production mode processing on tomcat despite JVM flags

This is a familiar old problem, but I really want to put it to bed once and for all! I have the following JVM flags set:

-XX: + CMSClassUnloadingEnabled -XX: + CMSPermGenSweepingEnabled -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES = true

but I’m still watching how a maximum usage speed of 50 Mb is imposed over each deployment cycle. I am deploying remotely using the tomcat manager application, and grails is in production mode.

If it is too full, kill -9!

I can try using Jrockit, but now this is not an option. I really do not find it acceptable in the production environment to refuse the entire container from time to time.

+4
source share
2 answers

The problem of leakage in perm is a question, no matter which application server you use when using grails, it is my experience (a very personal and probably easy-to-implement joke, just clear for that);

If this is the only application that you have deployed, why not just shutdown.sh, delete the webapp folder, put it to war, and then startup.sh?

This is the way we go, and the redistribution only takes about 7 seconds (where 5 of them are sleep 5 to ensure that Catalina shuts down completely before it returns).

Edit:

Having one tomcat instance for each application is pretty cool in my opinion!

+2
source

You may not be aware of this, but permgem will end up as long as you repeatedly turn on the hot Tomcat instance, as there are some classes that can never be correctly unloaded (either because classes are programmed, or some restrictions from Tomcat) no matter what options you use except restart.

+1
source

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


All Articles