Reputation: 5962
Is there any relationship between heap and perm size for JBoss? I'd like to increase max heap size but I'm not sure what sort of impact it will have for perm size. I'm running JDK 6. Currently I don't run into perm gen issues, but if I increase heap size is there an implicit relationship that requires me to increase perm gen space? Is there any rule of thumb essentially is what I'm asking?
Upvotes: 1
Views: 511
Reputation: 444
In order to understand the heap and permgen, maybe the following explanation about what is stored in PermGen (or Metaspace in Java 8) helps to understand both the purpose of permgen and difference from heap:
If you recall, everything in Java is represented as an Object. Also, all objects are instances from a specific Class. Even the Class declarations themselves are ultimately just very specific Objects. But what makes the class declarations interesting is the fact that on most JVMs Class declarations are loaded into a specific memory region, named Permanent Generation (PermGen for short).So – to recap: all Java classes are loaded and stored in the Java PermGen.
This consists of the following:
That’s pretty much it. Some more bits and pieces but it does not impact the actual memory consumption by more than few percent. All of these are allocated to PermGen and stay in PermGen.
As you can see, the PermGen size requirements depend heavily both upon the number of classes loaded as well as the size of such class declarations. So - in general, the more classes in the application you load into the JVM, the bigger the PermGen you are going to need.
Upvotes: 1
Reputation: 3059
No, you do not necessarily need to increase perm gen size, if you increase the overall heap size. The perm gen space holds the classes loaded by the JVM. If your deployed application does not change, the amount of data to store in the perm gen space also stays the same - even if the overall available heap space is increased.
The relation ship is rather the other way round - if you increase the perm gen size, you will have less heap space available for your application -> in this case, you would probably consider to also increase the overall heap size.
Upvotes: 1