## Analyze Performance: Advanced Options

See Also

When analyzing application performance, you can create a custom configuration and set more advanced profiling options.

You set the advanced options by clicking Advanced Settings in the configuration pane for your custom configuration. Click Basic Settings to set the configuration options in the Basic Options pane.

The Advanced Settings pane enables you to set the following options:

### Settings

- Methods Tracking. When tracking methods, a "method entry" call is injected at the beginning of each profiled method, and a "method exit" call before each `return`. You can choose the granularity of tracking by selecting one of the following options:
  - Exact Call Tree and Timing. When selected, the time spent in the method is calculated as the difference between the timestamp that is generated for each "method entry" and corresponding "method exit".
  - Exact Call Tree, Sampled Timing. When selected, you must specify a sampling interval. The time spent in the method is calculated as the difference between the timestamp that is generated for the "method entry" and corresponding "method exit" that fall approximately at the end of each sampling interval.

  For more about which option to choose, see the following NetBeans FAQ:

- Exclude time spent in Thread.sleep() and Object.wait(). When selected, these methods are not profiled.
- Profile underlying framework setup.When selected, startup of the application's target JVM is also profiled.
- Profile new Threads/Runnables. When selected, instruments the code for any thread or runnable started after the application enters the root instrumentation method. This is selected by default when profiling the entire application.
- Limit number of profile threads. When selected, every time a thread that has not been previously registered enters the instrumented code, this counter is decremented. When it reaches zero, registration of new threads is stopped. Profiling data is collected only for the registered threads.
  To reset the counter to this value, choose Profile > Reset Collected Results from the the main menu.

  For more about when to use these option, see the following NetBeans FAQ:

- Use thread CPU timer (Solaris only).

  For more about using timers, see the following NetBeans FAQ:

- Instrumentation Scheme. Select an instrumentation scheme to limit the number of instrumented methods. (Usually, it is best if the number of instrumented methods and the number of methods actually called by the application when it is profiled are the same or very close.)
  - Total (default) - This scheme is more appropriate if you want to profile application startup, or an entire application such as a short-running command line utility.
  - "Lazy" - This scheme is usually the most appropriate when you want to profile a subset of the application code (for example, just one or more servlets running on top of an application server). Results in the smallest number of methods being instrumented.
  - Eager - This scheme is not recommended for long-running applications. Eager instrumentation is a compromise between the Total and Lazy schemes.

  For more about instrumentation schemes, see the following NetBeans FAQ:

- Instrument: Method.invoke(), Getter/setter methods, empty methods. By default these types of methods are not instrumented.

  For more about instrumenting these methods, see the following NetBeans FAQ:

### Threads

Enable Threads Monitoring. When selected, application threads are monitored from application startup. When deselected (default), thread monitoring does not begin until you click the Threads button in the Threads window.

### Global Settings

Override Global Settings When selected, you can override the global settings and specify the following options when profiling the application:

- Working Directory. Use this option to specify the directory that will become current for your application when it starts. For example, you may need to specify a specific working directory when attaching to a local application.
- Java Platform. Use this option to specify a target JVM other than the default JVM the IDE is running on. You can choose any Java platforms registered in the Java Platform Manager.
- JVM Arguments. Specify any arguments to pass on to the JVM, for example, the default maximum heap size.

See Also
  Analyze Performance: Basic Options
  Analyzing CPU Performance
  Profiling a Project or Class
  Setting Profiling Points

Legal Notices