Is java PermGen space part of the total VM memory?

 ̄綄美尐妖づ 提交于 2019-11-29 17:44:35

问题


Assuming I start my java VM with the following parameters:

-Xms1024m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m

Do the 512m PermGen space add to the 1024m memory or are they part of it? Or in other words, do I have a total memory consumption of 1536m or of 1024m? In the latter case, does that mean that the application has only 512m for purposes other than PermGen space?

Please let me know in case this question reveals a lack of understanding PermGen space. ;-)


回答1:


The -Xms and -Xmx parameters refer to heap memory, whereas the PermGen space is a separate memory pool.

In other words, the total memory size available to your Java application will be 1.5 GiB rather than 1 GiB, and you'll get the full gigabyte of space for heap-allocated objects.




回答2:


I just bumped on this page through Google. This is certain confusion whether PerGen is part of Heap or not: The answer is "Heap is broken up into smaller parts/generations and these parts are: Young Generation, Old or Tenured Generation, and Permanent Generation". This is what Oracle says to say the least. It makes much more sense to go by what originator says than by the audience on the web domain.

A short note on PermGen: Permanent generation contains metadata required by the JVM to describe the classes and methods used in the application. The permanent generation is populated by the JVM at runtime based on classes in use by the application. In addition, Java SE library classes and methods may be stored here.




回答3:


In Sun's JVM, the permanent generation is not part of the heap. It's a different space for class definitions and related data, as well as where interned strings live.



来源:https://stackoverflow.com/questions/4223809/is-java-permgen-space-part-of-the-total-vm-memory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!