[英]How to clear permgen memory space
I am using MAT to analyze memory.我正在使用 MAT 来分析内存。
Size: 14.4 MB Classes: 7k Objects: 350.9k Class Loader: 116
I've got the above report using MAT memory analyzer.我已经使用 MAT 内存分析器获得了上述报告。 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.我们可以清理 permgen 内存,或者我必须增加
eclipse.ini
文件中的xms, xmx and launcher.XXMaxPermSize
大小,并确保所有对象在使用后都无效。
As far as I know there is no function that clears permgen.据我所知,没有清除 permgen 的功能。 On default, jvm holds all the loaded classes indefinitely.
默认情况下,jvm 无限期地保存所有加载的类。 But you can change this behaviour using -
XX:+CMSClassUnloadingEnabled
and - XX:+UseConcMarkSweepGC
parameters.但是您可以使用 -
XX:+CMSClassUnloadingEnabled
和 - XX:+UseConcMarkSweepGC
参数更改此行为。
If you use CMSClassUnloadingEnabled
parameter the GC will also sweep PermGen and remove classes which are no longer used.如果您使用
CMSClassUnloadingEnabled
参数,GC 还将清除 PermGen 并删除不再使用的类。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.