How to clear permgen memory space

爱⌒轻易说出口 提交于 2020-06-23 14:19:08

问题


I am using MAT to analyze memory.

Size: 14.4 MB Classes: 7k Objects: 350.9k Class Loader: 116

I've got the above report using MAT memory analyzer. But I can't find any way to clear those classes, objects.
Is there any way to remove all those object and clean permgen memory.
Can we clean permgen memory or I have to increase xms, xmx and launcher.XXMaxPermSize size in eclipse.ini file and make sure all object are nullify after use.


回答1:


As far as I know there is no function that clears permgen. On default, jvm holds all the loaded classes indefinitely. But you can change this behaviour using -XX:+CMSClassUnloadingEnabled and -XX:+UseConcMarkSweepGC parameters.

If you use CMSClassUnloadingEnabled parameter the GC will also sweep PermGen and remove classes which are no longer used.



来源:https://stackoverflow.com/questions/31231357/how-to-clear-permgen-memory-space

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