Switch to standard view 
  Sybase logo
 
 
 



Integrating OptimizeIt in Sybase EAServer

Author: Samir Nigam, EAServer Engineering, Sybase

Document Overview

This document describes how to integrate OptimizeIt software (Profiler, Thread Debugger, Code Coverage) in Sybase EAServer. Details in this document are developed for Borland OptimizeIt version 4.1 and 5.5 running in Sybase EAServer version 4.2.2 and 5.0 (beta release) using Sun JDK 1.3.1 and 1.4.1 on Microsoft Windows 2000. Parts of this document are adopted from OptimizeIt documentation. We assume that you have already installed OptimizeIt software appropriately.

What is OptimizeIt

Borland OptimizeIt is a software engineering tool for identifying performance related issues in a Java program. OptimizeIt Suite includes OptimizeIt Profiler, OptimizeIt Thread Debugger and OptimizeIt Code Coverage to pinpoint performance and reliability problems in Java code including memory leaks, performance bottlenecks, and thread problems. For further information, please check Borland website.

How OptimizeIt Works

OptimizeIt is divided into 2 parts:

  1. The Audit System, which runs in the java virtual machine of the EAServer and collects the performance testing data.

  2. The OptimizeIt GUI, that attaches to the audit system, displays the performance testing data, and interacts with the Audit System.

In order to integrate OptimizeIt with EAServer, you need to start the Audit System in the virtual machine of EAServer. Once the Audit System is started, you can start the OptimizeIt GUI and attach to the audit system. At that point, you can get the testing information for your Servlets, JSPs and EJBs just by executing them. The following sections explain how to configure EAServer to run with the Audit System and how to interact with the Audit System running in the virtual machine of EAServer.

EAServer Configuration Changes

Virtual Machine Startup Parameters

Following changes are needed in EAServer startup script (%JAGUAR%\bin\serverstart.bat) and Server properties file (%JAGUAR%\Repository\Server\Jaguar.props).

serverstart.bat:

Modify EAS_CLASSPATH_P1 to add <OptimizeIt_Directory>\lib\optit.jar.

set EAS_CLASSPATH_P1=%EAS_CLASSPATH_P1%;<OptimizeIt_Directory>\lib\optit.jar

Modify EAS_BOOTCLASSPATH_P1 to add <OptimizeIt_Directory>\lib\optit.jar  and <OptimizeIt_Directory>\lib\oibcp.jar.

set EAS_BOOTCLASSPATH_P1=%EAS_BOOTCLASSPATH_P1%;<OptimizeIt_Directory>\lib\optit.jar

set EAS_BOOTCLASSPATH_P1=%EAS_BOOTCLASSPATH_P1%;<OptimizeIt_Directory>\lib\oibcp.jar

Modify EAS_PATH_P1 to include <OptimizeIt_Directory>\lib directory.

set EAS_PATH_P1=%EAS_PATH_P1%;<OptimizeIt_Directory>\lib

Jaguar.props:

Change server property ?com.sybase.jaguar.server.jvm.options? (edit Jaguar.props or via Jaguar Manager) to add the following values.
           

OptimizeIt 4.1

This version supports JDK 1.3 only. Please add following to the above mentioned server property:

-classic,-Xrunoii,-Xrunpri,-Djava.compiler=NONE,-Xnoclassgc,-DGCOPSIZE=5

OptimizeIt 5.5

If you are using JDK 1.3.1 classic VM:

-classic,-Xrunoii,-Djava.compiler=NONE,-Xnoclassgc,-DGCOPSIZE=5

If you are using JDK 1.3.1 or 1.4.x, or want to use JDK 1.3.1 with Hotspot VM:

-Xrunoii,-DGCOPSIZE=5

Please make sure that ?com.sybase.jaguar.server.jvm.nojit? is set to true in server properties file.

Adding OptimizeIt Servlet to EAServer (OptimizeIt 4.1 only)

  1. Use Jaguar Manager GUI to deploy OptimizeIt web application. The OptimizeIt Servlet WAR file is <OptimizeIt_Directory>\lib\servlet\optimizeit.war.

  2. After deployment, highlight the OptimizeIt web application and bring up its properties window. Set its context-path to what you like. We set it to ?optit.?

  3. Install the ?optimizeit? web-app to the Jaguar server.

Note About Security Issues

You may need to grant all permissions to OptimizeIt application for proper execution in EAServer. You can set these permissions by modifying the policy file in %JAVA_HOME%\jre\lib\security\java.policy. The JAVA_HOME directory is typically %JAGUAR%\jdk\<jdk of your choice>.

Example: The following lines are added to the above mentioned policy file:

grant codeBase "file:<OptimizeIt_Directory>\lib\optit.jar" {
              permission java.security.AllPermission;
};

This concludes one-time steps required to integrate OptimizeIt in EAServer.


Enabling OptimizeIt Audit System in EAServer at runtime

Following steps are required to activate OptimizeIt system in EAServer when it is started.

1. Starting OptimizeIt GUI and EAServer

 

a..

Using the OptimizeIt Audit System selector in Windows system tray or from the programs menu, select the OptimizeIt tool you currently wish to use with EAServer. Now click on ?Remote Application? tab from the settings option and click OK.

 

b.

Start EAServer now in normal mode using JVM of your choice. We have tested EAServer running JDK 1.3.1 classic VM with OptimizeIt 4.1. You can run EAServer with JDK 1.3.1 or 1.4.1 Hotspot VM (server or client) besides classic VM with OptimizeIt 5.5. We recommend using classic VM for OptimizeIt analysis.

%JAGUAR%\bin\serverstart.bat -jvmtype classic

When using JDK 1.4.1 with hotspot VM (server or client), following error message is printed on the EAServer console. The Audit System still works but we recommend checking OptimizeIt documentation for more details. You may choose to update server JVM options property ( -Xrunoii:directi=f) to avoid this warning.

********************************************************************************

Warning: Using direct instrumentation is not possible with this virtual machine.

In order to minimize profiler overhead, it is better to disable this feature.

To disable this feature, edit the file <OptItDir>/lib/directi.table and make

sure the following line is present:

    disabledFor = ( {version="1.4.1_03"; vendor="Sun Microsystems Inc.";} );

You can also start with the option directi=f ex: ...-Xrunoii:directi=f

********************************************************************************

2. Starting the OptimizeIt Servlet (OptimizeIt 4.1 only)

The OptimizeIt Servlet allows you to start OptimizeIt Audit System in the virtual machine of EAServer. Once OptimizeIt runs in the virtual machine of  EAServer, you can attach to EAServer with the selected OptimizeIt tool such as profiler for memory leak analysis.

 

a.

Invoke the servlet from the browser. (http://localhost:8080/optit/OptimizeIt).

 

b.

Press the Start button on the HTML page that the servlet provides if you select to use the Profiler or Code Coverage from the Audit System Selector. Thread Debugger does not require you to actually use the OptimizeIt servlet. The Thread Debugger is automatically started when you start EAServer and Thread Debugger has been selected in the Audit System Selector.


3. Attaching OptimizeIt GUI to EAServer

 

Once EAServer is running with the OptimizeIt Audit System, you can now attach to the java virtual machine in EAServer.

 

a.

From the Program menu, select Attach.

 

b.

Change the port number and the hostname if necessary.

 

Press the Attach button.  You are now connected to JVM running within EAServer. Please check OptimizeIt documentation for features and capabilities of the GUI.

References

  1. Sybase EAServer System Administration Guide, available in the Core
    Documents collection for your EAServer version at http://sybooks.sybase.com/eag.html.
  2. Sun JDK 1.3.1 and 1.4.1 Documentation.
  3. Borland OptimizeIt documentation bundled with the software.


Back to Top
© Copyright 2010, Sybase Inc.