fredag, november 16, 2007

Don't Forget of the Permanent Generation...

This week I was at a customer where we would install a SOA Suite server and deploy quite a lot of BPEL processes onto it. Most things went fine until the end of the deployment where we encountered a problem: java.lang.OutOfMemoryException, I was first a bit confused since we had assigned 2Gb of memory to the JVM - so how could that be?

Simple, I forgot about the Permanent Generation Size, and this post is my equivalent of writing it on the black board 100 times in order to remind myself to not forget about it again in the future...

We solved the problem by adding these 2 JVM parameters:

-XX:PermSize=256 -XX:MaxPermSize=256m

So, what do they do?

The permanent generation is allocated outside of the normal heap and holds objects of the VM itself such as class objects and method objects. If you have programs that load many classes (like deployment of many BPEL processes in a batch), you may need a larger permanent generation.

Since the sizing of this is done independently from the other generations, this means that even if you setup a heap of 2Gb, you might still encounter problems in the permanent generation cause if you do not specify this it will fallback on the defaults .

Why are they set to the same value above? Simply because we want to minimize large garbage collection here.

Once we had reconfigured the OC4J instance with these settings the deployment went fine.




Inga kommentarer:

Skicka en kommentar