Saturday 11 February 2017

Optimizing WebLogic Server Performance: JVM Tuning

Understanding garbage collection

It uses for a free memory occupied by objects that are no longer being used by the application. The Java Language Specification (JLS) does not require a JVM to have a garbage collector.All of the commonly used JVMs have garbage collectors, and most garbage collectors use similar algorithms to manage their memory and perform collection operations. we need to understand how the JVM performs garbage collection so that we can identify the tuning . The garbage collection algorithms and implementations, it is possible to tune the application and gc behaviour to max its  performance. 

Garbage collectors will identify an object is eligible for collection by objects are being referenced by any active objects in the system tor not. They are garbage tho general approaches for this are :
  • Reference counting 
  • Object reference traversal 

We have  Some garbage collectors used by modern JVMs are:
  • Mark-and-sweep collector 
  • Mark-sweep-compact collector 
  • Copying collector 
  • Incremental collector 
  • Generational collector 
  • Concurrent collector 
  • Parallel collector Object lifetimes

Performance wise:

There are two primary types of garbage collection performance:


  1. Throughput is the percentage of total time not spent in garbage collection.
  2. Pauses are the times when an application appears unresponsive because garbage collection is occurring.

The performance wise we need to choose one of the two optimisations:


  1. Max throughput - Java threads get as much as possible CPU resources.
  2. Min pauses - Response time of the application is maximized.

To optimize we have to iterate through the following steps:


  • Gather garbage collection information:
  • Use this information to adjust JVM parameters.
  • Check if the desired result is obtained, if not, gather garbage collection information.

No comments:

Post a Comment