Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
package org.lcsim;

public class ProfilingTest 
{
    public static void main(String args[])
    {
        System.out.println("hello profiler");
    }
}

This class needs to be designated as the project's main run class. Right - click on the LCSim project, again and select Properties and go to the Run window. Enter the fully qualified name of your class in the Main Class field. -> Run.

Paste the string you saved earlier into the VM Options field.

The Run settings should now look similar to this.

Image Added

Netbeans will now wait for a profiler connection before running your main routinePut the profiler connection string into Arguments and VM Options.

Setup the Profiler

The profiler needs to be calibrated before it can be used. Select Profiler -> Advanced Commands -> Run Profiler Calibration.

...

Copy and paste the entire string beginning with "-agentpath" to a local scratch file. This will be needed to connect the running code to the profiler.

Configure LCSim for Profiling

Right click on LCSim again and select Properties -> Run.

Paste the string you saved earlier into the VM Options field.

The Run settings should now look similar to this.

Image Removed

Now Netbeans will wait for a profiler connection before running your main.

Connecting to the Profiler

...