This tutorial explains how to profile
a WebObjects application that uses Java.
In this document:
- <WebObjectsDir> is the directory where WebObjects has been
installed (ex: c:\Apple).
- <OptItDir> is the directory where OptimizeIt has been installed
(ex: c:\OptimizeIt\OptimizeIt302D).
1) Configuring WebObjects
Uncompress optit.jar
-
Copy the file <OptItDir>\lib\optit.jar to the directory <WebObjectsDir>\Library\Java
-
From the command line, go to the directory <WebObjectsDir>\Library\Java:
cd <WebObjectsDir>\Library\Java
-
Uncompress the optit.jar file:
jar xf optit.jar
Note: your PATH environment variable must include the bin directory
of a JDK for jar to execute. If jar can't be found you can for example
use the JDK included with WebObjects, by adding the directory <WebObjectsDir>\Library\Jdk\bin
to your PATH environment variable.
Disable the JIT
-
Create a new directory called deactivated in the directory <WebObjectsDir>\Library\Jdk\bin
if it doesn't exist.
-
Move the file <WebObjectsDir>\Library\Jdk\bin\symcjit.dll to
the directory <WebObjectsDir>\Library\Jdk\bin\deactivated
Note: If you want to enable the JIT again when you are finished
with profiling, move the file <WebObjectsDir>\Library\Jdk\bin\deactivated\symcjit.dll
to <WebObjectsDir>\Library\Jdk\bin
Set the PATH environment variable
Add <OptItDir>\lib to your PATH environment variable.
2) Starting OptimizeIt profiler from your code
Starting OptimizeIt profiler can be easily done by using OptimizeIt's API.
-
Also, add the following code in the initialization:
Audit.start(1470, Audit.PROFILERS_ALWAYS_ENABLED);
-
Compile and run your WebObjects application.
Note: OptimizeIt's API is documented in OptimizeIt user manual,
chapter 9.
3) Attaching from OptimizeIt
Now that your WebObjects application is running with
OptimizeIt profiler, you can start OptimizeIt and attach to the virtual
machine.
-
Start OptimizeIt from the Start menu.
-
Close the Edit Settings panel by pressing
the OK button.
-
From the Program menu, select Attach.
-
Change the port number and the hostname if necessary.
-
Press the Attach button.
Note: OptimizeIt does not have a "detach"
function. If you press the stop button in OptimizeIt, the WebObjects application
exits. Unless you have set on the Auto recover function for the application,
you will have to start the application again..
Copyright (c) 1997, 1998, 1999,
2000 Intuitive Systems Inc. All rights reserved. Specifications subject
to change without notice.
OptimizeIt is a trademark of
Intuitive Systems, Inc.
Java and all Java-based trademarks
and logos are trademarks or registered trademarks of Sun Microsystems,
Inc. All other brand
names and products are trademarks
or registered trademarks of their respective holders.