Tuning Oracle WebLogic JVM

When trying to improve Oracle WebLogic server performances, scalability and reliability, tuning JVM (Java Virtual Machine) is probably the most important step. However, this is usually far from being an easy task. JVM tuning includes selecting the right JVM, setting the appropriate heap size, selecting the most appropriate GC (garbage collector) strategy, etc. An in-depth discussion is beyond the scope of this post, we will just get familiar with the basic steps:

1. Select the right JVM

For Oracle WebLogic server, we use one of the following JVMs: Oracle HotSpot or Oracle JRockit. HotSpot features techniques, such as JIT (Just-in-time) compiler and adaptive optimization designed to improve performances. HotSpot is the primary JVM for desktops and servers. JRockit, on the other hand, was designed from the ground up to be a server-side JVM. There has been a lot of debate which JVM provides better performances, but different benchmarks gave different results. However, JRockit offers much better scalability therefore it is more appropriate for server environments. JRockit also provides more in-depth instrumentation to give you more insight into what is going on inside the JVM at runtime. In general, HotSpot is usually used in development environments, while JRockit is the right choice for test and production environments.

JRockit and HotSpot code bases are currently being integrated, with target of releasing a JVM with combined code base around the release date of JDK 8.

2. Set the JVM startup parameters

We open and edit the WebLogic startup script, which can be found in MW_HOME/user_projects/domains/domainName/bin/setDomainEnv.sh (setDomainEnv.cmd on Windows). Using this script, we can allocate appropriate memory resources, select the GC scheme, etc.  In this post we will just demonstrate how to configure the java heap size. The Java heap is where the objects of a Java program live. It is a repository for live objects, dead objects, and free memory. When an object can no longer be reached from any pointer in the running program, it is considered “garbage” and ready for collection. The JVM heap size determines how often and how long the VM tiburon payday loan spends collecting garbage. An acceptable rate for garbage collection is application-specific and should be adjusted after analyzing the actual time and frequency of garbage collections. If you set a large heap size, full garbage collection is slower, but it occurs less frequently.

In the following example, we set the HotSpot JVM heap size using the -Xms and -Xmx flags. -Xms flag is used to set the initial heap size and the -Xmx flag sets the maximum heap size. Setting too low max heap size will sooner or later result in  “java.lang.OutOfMemoryError“. It’s a good idea to set the minimum and maximum heap size to the same value to improve performances.

set DEFAULT_MEM_ARGS=-Xms1024m -Xmx1024m

After changing the settings, we have to restart the server.

For more information on setting the heap size and selecting the GC strategy, see the following link: WebLogic server performance and tuning.

3. Continuously analyze and tune JVM

If we want to provide optimal performances and scalability, we have to continuously monitor and analyze JVM, as the number of deployed applications and the number of requests change through time. Some basic monitoring features are provided through WebLogic console. Under the Domain structure we expand Environment and then click on Servers. Then we select the server and open the Monitoring tab and click on the Performance tab. Here we can see various information, such as current heap size, heap free percent and max heap size. We can also manually run the garbage collector by clicking on the Garbage Collect button.

If we use a JRockit JVM we can also use a set of advanced tools called JRockit Mission Control. These tools enable us to effectively monitor, manage, and eliminate memory leaks. JRockit Mission control consists of the following tools:

  • an interactive Management Console, which visualizes garbage-collection and other performance statistics
  • a runtime performance profiling tool called Runtime Analyzer
  • a memory-analysis tool called Memory Leak Detector

The following screenshot shows the JRockit Mission Control Eclipse plug-in displaying the  current JVM statistics.

JRockit Mission Control can be downloaded here.

RSS Feed

3 Comments for Tuning Oracle WebLogic JVM

خرید vpn | August 8, 2017 at 10:35 pm

very nice

کلیپ خنده دار | January 15, 2018 at 12:16 pm

its awsome!

اخبار | January 15, 2018 at 12:16 pm

thanks!!

Leave a comment!

<<

>>