Is the author suggesting that setting the initial perm size and maximum perm size values to the same value can prevent full GCs from happening?
A memory space, either Old or Permanent, is full and to accommodate new objects or classes, it needs
to be expanded towards its max size, if the relevant parameters have different values. In other words, if
‐Xms and ‐Xmx have different values and if the size of Old needs be increased from ‐Xms towards ‐Xmx
to accommodate more objects, a FullGC is called. Similarly, if ‐XX:PermSize and ‐XX:MaxPermSize have
different values and the Permanent Space needs to be increased towards ‐XX:MaxPermSize to
accommodate new java classes, a FullGC is called. This can be avoided by always setting ‐Xms and ‐Xmx
as well as ‐XX:PermSize and ‐XX:MaxPermSize to the same value.
Java Performance Tuning Whitepaper:
http://mfinocchiaro.files.wordpress.com/2008/07/java-virtual-machine-neutral.pdf
I think he is saying that.
But I don’t think he is right. Certainly, I don’t recall ever having seen this mentioned in any official Sun / Oracle documents.
Note that:
It should be possible to get evidence one way or the other for this by turning on GC logging and seeing if there is a correlation between full GCs and heap expansions.
I have (often) heard that setting the initial and max heap sizes to be the same reduces JVM warmup overheads. It is the assertion / implication that each heap expansion is preceded by a full GC that I am dubious about.