Main Menu

KB#01069-Increasing performance in BBj

Title:

Increasing performance in BBj

Description:

We have been able to get a 10-15 percent increase in performance (over time*) in BBj by using the server JVM (instead of the client JVM) on our production server machine. The server JVM uses a different JIT compiler, compilation policy, heap defaults, inlining policy than the client JVM. For more information please see http://java.sun.com/docs/hotspot/. 

The current JIT compiler (1.2 thru 1.4, fixed in 1.5) used by the server JVM has a bug that causes one of the BBj internal math classes method (be/arci/math/BigDecimal divideAndRemainder) to fail. Until this issue is fixed, this method can not be "JITed". 

To find out if your JVM supports this option you can run: 
java -server -XX:NewSize=24m -XX:CompileCommandFile=<bbj install dir>/cfg/.hotspot_compiler -version 
        If no error occurs, then it is supported. 

In order to remove this class method from the JIT compiler and to turn on the server JVM in BBj please use the following instructions: 


Steps to turn on the server JVM on Linux (and other supported UNIXes) for BBj 
=========================================== 
1) Stop BBjServices 

2) Create the following file: 
<bbj install directory>/cfg/.hotspot_compiler 

3) The file should contain the following line of text: 
exclude be/arci/math/BigDecimal divideAndRemainder 

4) Ensure the account that BBjServices is running under has RW permissions to the file 

5) Add/Modify the following property/value in the "<bbj install directory>/cfg/BBj.properties" file: 
basis.java.args.BBjServices=-server -XX:NewSize=24m -XX:CompileCommandFile=<bbj install directory>/cfg/.hotspot_compiler 

6) Start BBjServices 



Steps to turn on the server JVM on Windows for BBj 
========================================== 
1) Stop BBj Services 

2) Create the following file: 
<bbj install directory>/cfg/.hotspot_compiler 
Note that you may need to create the file via the EDIT command in a DOS command shell if Windows complains about creating a file whose name starts with a period. 

3) The file should contain the following line of text: 
exclude be/arci/math/BigDecimal divideAndRemainder 

4) Ensure the account that BBjServices is running under has RW permissions to the file. 

5) Add/Modify the following property/value in the "<bbj install directory>/cfg/BBj.properties" file: 
basis.java.args.BBjServices=-XX:NewSize=24m -XX:CompileCommandFile=<bbj install directory>/cfg/.hotspot_compiler 

6) Add/Modify the following property/value in the "<bbj install directory>/cfg/BBj.properties" file: 
basis.java.jvm.BBjServices=<Java install directory>/jre/bin/server/jvm.dll 

7) Start BBjServices 


Verify that BBj is configured to use the server JVM 
========================================= 
Run the following test program to make sure that the server JVM is specified and the removal of the "be/arci/math/BigDecimal divideAndRemainder" method from the hotspot compiler was successful. This program should always return .11; if it returns 1 then it did not work correctly. Go back to step 1. 


10 ? "here comes the test:" 
20 one! = new com.basis.util.common.BasisNumber(1) 
30 nine! = new com.basis.util.common.BasisNumber(9) 
40 for x = 1 to 1000001 
50 z! = one!.divide(nine!) 
60 if(MOD(x,10000) = 0) ? x,":",z! 
70 next x 

Resolution:

Definition of "over time*": 

The default setting for the compiler threshold for the server JIT is 10,000 (-XX:CompileThreshold) where as the client compiler threshold is 1,500. This threshold is how many times does a method need to be executed before it is converted into native code. So it may take longer to get the JVM "warmed up" when using the server JIT, but once it is "warmed up" the server algorithm for compilation is more optimized for server applications. Before changing this threshold, please read the information in the following links, as this could cause a initial slowdown when running the applications, as well as "JITing" methods that are not used that often. 

http://java.sun.com/docs/hotspot/VMOptions.html 

http://www.javaworld.com/javaworld/javaqa/2003-04/01-qa-0411-hotspot.html 



Last Modified: 12/31/2004 Product: BBj Operating System: All platforms

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN ProfileVisit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel