URLClassLoader Memory Leak Java

守給你的承諾、 提交于 2020-01-06 21:01:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!