Why is the default size of PermGen so small?

前端 未结 3 1304
南方客
南方客 2021-02-04 03:52

What would be the purpose of limiting the size of the Permgen space on a Java JVM? Why not always set it equal to the max heap size? Why does Java default to such a small num

3条回答
  •  孤城傲影
    2021-02-04 04:02

    The PermGen is set to disappear in JDK8.

    What would be the purpose of limiting the size of the Permgen space on a Java JVM?

    Not exhausting resources.

    Why not always set it equal to the max heap size?

    The PermGen is not part of the Java heap. Besides, even if it was, it wouldn't be of much help to the application to fill the heap with class metadata and constant Strings, since you'd then get "OutOfMemoryError: Java heap size" errors instead.

提交回复
热议问题