JSP/PrimeFaces Spring Boot Tomcat memory leak issue -
i use
tomcat 8.0.26 jsf 2.2.12 primefaces 5.2 spring boot 1.2.6.release spring 4.2.1.release
i use reload
button in tomcat web application manager
, after reload of application(domain-api
)have following issue:
the following web applications stopped (reloaded, undeployed), classes previous runs still loaded in memory, causing memory leak (use profiler confirm): /domain-api
also, via java visualvm can see growth of javax.faces.*
objects after "reload"
this sampler memory snapshots comparison:
how fix ?
managed similar issue time ago, has been solved tunning java garbage collector in java_opts:
java_opts="$java_opts -xx:+cmsparallelremarkenabled -xx:parallelgcthreads=8 -xx:+usecmsinitiatingoccupancyonly -xx:cmsinitiatingoccupancyfraction=35 -xx:+useparnewgc -xx:+useconcmarksweepgc -xx:-useadaptivesizepolicy -xx:survivorratio=6"
where:
-xx:+usecmsinitiatingoccupancyonly avoid use of heuristic rules garbage collector funcionallity.
-xx:cmsinitiatingoccupancyfraction place when cms(concurrent mark sweeper) activated.
-xx:-useadaptivesizepolicy disabled sizing memory generations ( can set parameter -xx : survivorratio = 6 ) .
-xx:survivorratio=6 establish eden survivor relation 1:6, give more room young objects.
to optimize performance of garbage collector threads following parameters used:
-xx:+cmsparallelremarkenabled : reduce pauses between cms.
-xx:parallelgcthreads=8 sets number of parallel threads of garbage collection in 8 (one each server processor ) .
-xx:+useparnewgc collector parallelized unlike original collection in multiple threads when have multiple processors.
-xx:+useconcmarksweepgc concurrent collector garbage collection algorithm tries of work of garbage collection in background without stopping application threads while running.
in case these options memory released faster. eden , old memories cleaned faster , optimizing resource release.
Comments
Post a Comment