Question

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. ;-)

Was it helpful?

Solution

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.

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top