Why is the default size of PermGen so small?

前端 未结 3 1306
南方客
南方客 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:21

    PermGen is where class data and other static stuff (like string literals) are allocated.

    You'd rather allocate memory to the Java heap for your application data (Xms and Xmx, where young (short-lived) and tenured objects go (when the the JVM realizes they need to stay around longer)).

    So the historic PermGen 64MB default may be arbitrary but the having you explicitly set it lets you know (and control) how much static data your application is causing the JVM to store.

提交回复
热议问题