TITLE
    WebObjects 4: Using OptimizeIt! With WebObjects
Article ID:
Created:
Modified:
70067
5/24/99
10/8/99

TOPIC

    This article explains how to use the OptimizeIt! performance profiler with WebObjects 4 on Windows NT. This document assumes you are using OptimizeIt! 3.0 Professional Edition and WebObjects 4 on Windows NT 4.0.

    OptimizeIt! is a product of Intuitive Systems, Inc. For more information or to download a demonstration version of OptimizeIt!, visit their web site at http://www.optimizeit.com .

    This is an unsupported configuration. Apple will not guarantee or provide support for this procedure.


DISCUSSION

    Follow these steps to use OptimizeIt! with your WebObjects application on Windows NT:

    1. Install OptimizeIt!

    Follow the vendor's instructions to install OptimizeIt! Professional Edition. After installation, run the OptimizeIt.exe application. The Java setup wizard will prompt you for the location of your Java VM. The WebObjects Java VM is located in $NEXT_ROOT/Library/JDK.

    2. Uncompress optit.jar

    Find the optit.jar file and copy it to $NEXT_ROOT\Library\Java. By default, this file is installed into C:\Program Files\Intuitive Systems\OptimizeIt30D\lib. From a Bourne shell, manually uncompress this file with the command:

    jar xf optit.jar

    3. Add the OptimizeIt! .DLL's to your path

    Find the two OptimizeIt! libraries, audit11.dll and audit12.dll. Edit your PATH environment variable to include the directory where these files are located, or copy these libraries into a directory which is in your PATH.

    4. Modify Application.java

    Because a WebObjects Java application handles its own startup of the Java VM, you will not be able to start up a WebObjects application from within OptimizeIt! as you would with a traditional applet. Instead, you will need to enable the OptimizeIt! audit system inside your WebObjects application and instruct OptimizeIt! to communicate with the application via a specified port.

    In your WebObjects application, add the following statement to Application.java:

    import intuitive.audit.*;

    Also, add the following code to the constructor:

    Audit.start(1470, Audit.WAIT_FOR_OPTIMIZEIT);
    Audit.enableCPUProfiler();
    Audit.enableMemoryProfiler();


    5. Build and launch your application

    Make clean and recompile your application. Before you compile, make sure the JIT compiler is disabled. If the JIT is not disabled, you can disable it by moving the JIT DLL (normally called SYMCJIT.DLL) into the directory:

    /Apple/Library/JDK/bin

    You are now ready to start using OptimizeIt! To begin profiling, first launch the WebObjects application. Because of the Audit.WAIT_FOR_OPTIMIZEIT start option which was added to the Application constructor, the application startup will stop at a statement similar to the following:

    OptimizeIt! 3.0 audit system. (c) 1997-1999 Intuitive Systems Inc.
    Port is 1470

    Launch the OptimizeIt.exe application if you have not already. Since we are not starting an application process from OptimizeIt, there is no need to use the UI panel which comes up when the application is started. Do not enter any information into that panel.

    NOTE: OptimizeIt! will not work if your WebObjects application is started inside GDB.

    6. Attach your application

    Choose "Attach" from the OptimizeIt! "Program" menu. In the "attach" panel, enter the host name of the machine on which your application is running and 1470 for the port number. Press the "Attach" button.

    7. Collect profiling data

    Once you have successfully attached to OptimizeIt!, you can start your application with the Program item of the Start menu. OptimizeIt! allows you to collect profiling information on the Java portions of your WebObjects application. Please see the OptimizeIt! documentation for more information on profiling your application.


Document Information
Product Area: WebObjects
Category: WebObjects 4
Sub Category: Development
Keywords:

Copyright © 2000 Apple Computer, Inc. All rights reserved.