How to clear permgen memory space

前端 未结 1 427
忘掉有多难
忘掉有多难 2021-01-26 04:56

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 analyz

1条回答
  •  时光说笑
    2021-01-26 05:35

    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.

    0 讨论(0)
提交回复
热议问题