Tuesday, June 21, 2011

@ JVM memory management


 I would like discuss about the topic of JVM memory management for Windchill or FlexPLM application.
Tomcat /JVM memory allocation plays a very significant role in determining Windchill/FlexPLM Performance.
JVM  memory is divided broadly into Heap & non-Heap memory usage.What is Heap Memory?: Java VM allocates runtime data of all class instance and arrays to heap memory.
Heap memory is further divided in to three subtypes
1.    Eden Space/young Generation
2.    Survivor Space
3.    Old /Tenured Generation
Eden space/young generation:  is a pool where the memory is allocated when any object is initialized.
Survivor Space: is a pool where the memory is allocated for certain short lived objects (survived after Eden space garbage collection)
Old /Tenured Generation: This pool contains the long lived object (survived for sometime in Survivor Space).
Later in this article would talk about allocating Heap memory and percentage allocation for each of this Pool. Let me first clarify Non- heap memory.
Non-heap memory: This pool holds all the data related to threads, constructors, methods & related class structures.
Non-heap memory is further divided in to two subtypes
1.    Permanent Generation(Perm Gen.):
2.    Code cache
Permanent Generation (Perm Gen.): The pool holds the reflective data of the virtual machine (class & methods)
Code cache: Memory is utilized for compilation data, code data & package information.
Heap memory allocation for JVM’s :
1.We need to monitor the Heap memory usage and the heap memory requirement for the application,
It is always good to keep the initial heap memory & max heap memory size at same value.
2. In applications like Windchill, its better to allocate 40% of heap memory to Eden space/Young generation – initial size and keep the Survivor ratio as 8,
so that most of objects are collected and cleared in Eden Space and Survivor Space before getting collected in tenured Space (else it might happen Tenured /old gen. space fills up quickly)
Please specify the following options for all the JVM’s(Tomcat & Windchill method Server) so that Garbage Collection efficient and effective.
1.    Disable Explicit GC.
2.    Use parallel GC
Now coming to Non-heap memory allocation,
 We can define Max Perm Size at around 20% of max heap memory and
 Initial Perm size is 10% of max heap memory.

In my future blogs, I would like to take you through different tools/methodologies used for Performance monitoring and capturing the data, analysis the logs to identify the root causes.

No comments:

Post a Comment