简体   繁体   中英

tomcat: undeploying war file won't unload classes

I'm using :

  • tomcat 7.0.62
  • java 1.8.65

    Suddenly i find my web application unresponsive, using jvisualVM just find out that the Metaspace acquired more than 3GB and loading 700K classes but my application only loads about 20K of classes. I've been deploy/undeploy my application so many times in last few days and suspect that would be the reason of so many loaded classes.

Should'nt tomcat unload classes by undeploying applications, Normally or my app has a memory leak ?

PS: Reading catalina.log saw many logs about failed to stop some threads and it would be memmory leak, etc.

The garbage collector can only collect what's not referenced any more. If your application starts threads and doesn't stop them, there's your reference.

Figure out what threads don't get stopped and make corrections so that they are. That should fix your problem.

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