In some environments, it is impossible to start the Java code from OptimizeIt's user interface or from the command line because another native program starts the Java virtual machine. Assuming that the program starting the virtual machine allows you to change basic Java options, classpath and library path, it is possible to profile your Java code with OptimizeIt. Profiling in this case is done by: In this document, <OptItDir> is the directory where OptimizeIt has been installed. (ex; c:\Program Files\Intuitive Systems\OptimizeIt302D)

1) Requirements

2) Virtual machine startup parameters

In order to start profiling with OptimizeIt, the following parameters should be set:

3) Starting OptimizeIt's profiler from Java code

Starting OptimizeIt profiler can easily be done by using OptimizeIt's API. OptimizeIt's API is documented in OptimizeIt user manual, chapter 9. The following code demonstrates how to start the profiler from any Java code.
import intuitive.audit.Audit;
...
static boolean isProfilerStarted = false;
 if(!isProfilerStarted) {
        /* Start OptimizeIt's profiler */
        Audit.start(1470, Audit.PROFILERS_ALWAYS_ENABLED);
   isProfilerStarted = true;
  }
...

Note: you will need to add <OptItDir>\lib\optit.jar to compile this code.

4) Profiling session

Note: OptimizeIt does not have a "detach" function. If you press the stop button in OptimizeIt, the virtual machine running the tested application will exit.
 

Copyright (c) 1997, 1998, 1999 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.