Efficient garbage-collecting Java Heap is managed in generations - memory segments holding objects of different ages. Garbage collection algorithms in each generation are different. Objects are allocated in a generation for younger objects - the Young Generation, and because of infant mortality most objects die there. When the young generation fills up it causes a Minor Collection. Assuming high infant mortality, minor collections are garbage-collected frequently. Some surviving objects are moved to a Tenured Generation. When the Tenured Generation needs to be collected there is a Major Collection that is often much slower because it involves all live objects. Each generation contains variables of different length of life and different GC policies are applied to them.
There is a third generation too - Permanent Generation. The permanent generation is special because it holds meta-data describing user classes (classes that are not part of the Java language). Examples of such meta-data are objects describing classes and methods and they are stored in the Permanent Generation. Applications with large code-base can quickly fill up this segment of the heap which will cause java.lang.OutOfMemoryError: PermGen no matter how high your -Xmx and how much memory you have on the machine.
To set the Heap Size and Maximum heap size use the following options.
-Xms and -Xmx options set starting heap size and maximum heap size respectively.
Recommended settings
-Xms2048m -Xmx4069m -XX:PermSize=512m -XX:MaxPermSize=1024m
This BLOG focuses on "hands on approach" around Oracle Fusion Middleware, Oracle Service Bus, Oracle AIA, Oracle SOA Suite, Oracle Identity Management including OID, OAM, OIM, OSSO, OER(Oracle Enterprise Repository), OSR(Oracle Service Registry), Oracle Big Data, WLST Scripts and Oracle Edifecs B2B Engine for X12/EDIFACT EDI. I strongly believe gaining cognizance is an incessant process and sharing technology experiences with all, has a reciprocated benefit.
Thursday, April 28, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment