问题
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