问题
I have been going through a lot of URLClassLoader
Memory leak solutions on the internet, but I haven't found any fully working code and precise solution. The closest to a solution I found was this
Any fully functional code or link to it, which uses WeakHashMap() or any other definite way of eliminating memory leak problem on multiple redeploys?
回答1:
just add the dependency of class loader leak preventer in your build path. maven dependency for this is :
<!-- For Classloader leak protection -->
<dependency>
<groupId>se.jiderhamn</groupId>
<artifactId>classloader-leak-prevention</artifactId>
<version>1.8.0</version>
</dependency>
来源:https://stackoverflow.com/questions/30565831/urlclassloader-memory-leak-java