This tutorial explains how to profile Java code
with BEA WebLogic 4.5.1 and WebLogic 5.0
We advise you to use the wizard for WebLogic that OptimizeIt features,
which performs automatically the steps described in this tutorial. This
wizard can be started from OptimizeIt by selecting the Tool/Application
server integration/WebLogic menu.
In this document, <OptItDir>
is the directory where OptimizeIt has been installed. (ex: c:\OptimizeIt31D),
and <WebLogicDir> is the directory where WebLogic has been
installed (ex: c:\WebLogic).
1) Configuring the startWebLogicWithOptimizeIt script
-
Copy the file startWebLogicWithOptimizeIt.bat
located in the <OptItDir>\Tutorial\script to the WebLogic's
root directory.
-
Edit the new copied file <WebLogicDir>\startWebLogicWithOptimizeIt.bat
-
Enter the directory of your JDK after the statement:
set JAVAHOME=
-
Enter the path to your OptimizeIt directory after
the statement:
-
(Optional) Change the port number used by the audit system if necessary
by modifying the line:
set PORT=1470
Note: This port is used by OptimizeIt to communicate with its
audit system. It is not related to WebLogic's ports. You should not have
to change this value unless another application already uses the port 1470.
-
(Optional) Uncomment the line:
2) Configuring the weblogic.policy file
In order to be able to profile using the java 2 (jdk
1.2 or 1.3), you will need to give OptimizeIt's classes the correct rights:
-
Edit the <WebLogicDir>\weblogic.policy
file
-
Add the following lines at the end of the file:
3) Starting WebLogic
To start WebLogic, invoke the startWebLogicWithOptimizeIt.bat
script:
startWebLogicWithOptimizeIt.bat
4) Attaching from OptimizeIt
Now that WebLogic 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, WebLogic server exits. After doing this,
you need to restart WebLogic server.
5) Filtering resources used by WebLogic
OptimizeIt provides filters for filtering resources used by WebLogic. In
order to use filters, you must create an OptimizeIt setting for the profiling
session, turn on the WebLogic filter, and then attach by using the
Attach now button or pressing the play button.
-
Start WebLogic using the startWebLogicWithOptimizeIt.bat
script.
-
Start OptimizeIt from the Start menu.
-
Close the settings editor by pressing OK.
-
From the File menu, select New
-
In the Edit Settings panel select Remote
Application in the Program type part.
-
Change the hostname or the port number if necessary.
-
Switch to the Filters section by clicking the
Filters
tab.
-
In the table, find the line with the name BEA
WebLogic.
-
If you want to ignore CPU or time consumed by
WebLogic, check the Ignore CPU usage column on that line.
-
If you want to ignore object allocations performed
by WebLogic, check the Ignore Memory usage column on that line.
-
Press the Attach now button.
Note: OptimizeIt settings can be saved for subsequent usage. This
is done by using the save menu.
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.