简体   繁体   中英

Apache Shiro Enums still in memory on Tomcat undeploy

When I undeploy a webapp that uses Apache Shiro, Tomcat Manager will detect leaks. I looked at the heap and searched for "org.apache.shiro.*" and I see that all of the Enums that Shiro uses, such as Cookie.SameSiteOptions, are still loaded in memory. Is there a way to prevent these from staying loaded in memory when I undeploy the webapp? Would it cause a problem over time if I keep redeploying without restarting Tomcat?

Use a memory profiler to find the "GC roots" for the Shiro objects left around in memory.

You should always be able to trace an object back to a live object which is holding it in memory. You may find that the application's ClassLoader has been pinned in RAM due to some leak, and therefore everything loaded for your application will stick-around indefinitely.

Tracking-down these kinds of leaks is very important if you expect to be able to redeploy your application many times without restarting the JVM.

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