Reputation: 499
I was reading a doc on java GC
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.
Wondering why is a FullGC called in this case? Whats the use?
Upvotes: 3
Views: 2369
Reputation: 5659
Upvotes: 0
Reputation: 533820
Resizing the heap is not just a matter of adding more memory. There is data structures the GC uses which have to be resized and this requires a FullGC to be preformed to do this.
Upvotes: 2