天天看点

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

下面是profiler的帮助,这里只贴一些Profiling tasks,其余请到:

http://www.netbeans.org/ 

profiler help

  • Home
  • Getting Started
  • Profiling Tasks
  • Control Panel
  • Profiling Results
  • Additional notes

Home

Profiling Tasks

The Select Profiling Task dialog box is the main interface for selecting and running profiles.

Choosing a profiling command

The dialog box gives you five different ways of profiling the target application. The first four items correspond to predefined profiling commands. The last command, Run Custom Profiling, allows you to create your own custom profiling configuration.

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

You can choose from the following profiling commands:

  • Monitor Application

    This profile command returns high-level information about several important properties of the target JVM, including thread activity and memory usage.

  • Analyze Performance

    This profile command returns detailed data on application performance. You can choose to analyze the entire application, part of the application, or startup performance.

  • Analyze Code Fragment Performance

    This profile command returns data on the performance of the code fragment you specify.

  • Analyze Memory Usage

    This profile command returns data on object allocation and garbage collection.

  • Run Custom Profiling

    This command is for running custom profiling configurations. You can create, edit and save these custom configurations, allowing you to control all the internal profile settings.

When you click on a profiling command the box expands, displaying a brief explanation of the command and, for some tasks, allowing you to set some profiling options. Clicking Run at the bottom of the dialog box launches the target application and starts the selected profiling command.

Only one task, i.e. one kind of profiling, can be active for the profiled application at the given time (note, however, that monitoring is always active, even when another task is chosen, since its overhead is very low).

See also

  • Monitor Application
  • Analyze Performance
  • Analyze Code Fragment Performance
  • Analyze Memory Usage
  • Custom Profiling

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

profiler help

  • Home
  • Getting Started
  • Profiling Tasks
  • Control Panel
  • Profiling Results
  • Additional notes

Home > Profiling Tasks

Monitor Application

When you choose the Monitor Application option, the target application is started without any instrumentation. The results display only high-level information about several important properties of the target JVM.

How To Run The Monitor Application Command

  1. Choose Profile > Profile Main Project (
    netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help
    ) from the main menu to open the Select Profiling Task dialog box.
  2. Choose Monitor Application. The only option available is Enable Threads Monitoring. (Select Enable Thread Monitoring to get more detailed information about thread activity in the target application.)
  3. Click Run at the bottom of the dialog box to launch the application and start the monitoring task.

To view monitoring results

When monitoring the application, the results are displayed in the VM Telemetry tab and the Threads tab in the Source Editor. Use the buttons in the View section of the Profiler window to open the tabs.

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

VM Telemetry

Click the Telemetry button in the Profiler window to open the VM Telemetry tab.

The Telemetry tab displays high-level data on thread activity and memory heap and garbage collection in the VM.

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

Threads

Click the Threads button in the Profiler window to open the Threads tab.

When Enable Threads Monitoring is selected in the Select Profiling Task dialog box, application thread activity is displayed in the Threads tab. You can also click the Threads button in the Threads tab to start thread monitoring.

Profiler monitors the application during all profiling tasks. You can click the Threads and Telemetry buttons when running any profiling task to open the tabs.

See also

  • Profiling Tasks
  • Profiler Control Panel
  • Thread Monitoring

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

profiler help

  • Home
  • Getting Started
  • Profiling Tasks
  • Control Panel
  • Profiling Results
  • Additional notes

Home > Profiling Tasks

Analyze Performance

You can choose to analyze the performance of the entire target application or limit the profiling to a part of the application code, even down to a specific code fragment.

How to Analyze CPU Performance in Profiler

  1. Choose Profile -> Profile Main Project (
    netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help
    ) from the main menu.
  2. Select Analyze Performance in the Select Profiling Task dialog box.
  3. Select one of the following profiling options:
    • Application Performance
    • Part of Application
    • Application Startup
  4. If desired, specify an existing filter or create a new custom Filter Set for the classes.
  5. Click Run at the bottom of the dialog box to launch the application and start the monitoring task.

To display profiling results, click the Live Results button (

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

) in the Profiler window. The results are displayed in the Profiling Results tab.

Profiling options

Application Performance

Application Performance profiles method-level CPU performance (execution time). You can choose to profile the entire application or a part of the application.

  • Entire Application.

    In this mode, Profiler instruments all of the methods of the profiled application. Threads emit the "method entry" event when entering a method and generate the corresponding "method exit" event when exiting the method. Both of these events contain timestamps. This data is processed in real time.

  • Part of Application.

    In this mode, you can instrument and profile a limited subset of the application's code. When partial application profiling is initiated, profiling data is not collected until one of the application's threads enters the profiling root method. Profiling a limited subset of the application's code may greatly reduce the profiling overhead. Furthermore, for some programs this option may be the only way to obtain any detailed and/or realistic performance data at all as the amount of generated data when the entire application is profiled can be so high as to render the application unusable or even cause it to crash (for example, due to unexpected timeouts).

  • Application Startup

    Use this mode when you want to analyze application startup time.

Filtering Classes

You can further control the temporal overhead (at the cost of reducing the amount of information obtained ) by filtering the profiled classes. You can select from the following filter options in the combo box or click Customize Filter to create a custom filter set.

  • Profile All Classes

    Select this option to run the task without filtering the classes.

  • Quick Filter

    This choice opens the Set Quick Filter dialog box, where you can simply enter the filter type and value(s). The filter uses a simple "starts with" comparison on profiled methods, classes or packages, so the filter value should be only a valid Java identifier. To specify more than one term, separate the terms with a space or comma (and space), for example "java., javax., sun."

    netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help
  • Defined Filter Sets

    You can select the predefined Profiler filter (Exclude Java Core Classes) or define your own Filter Sets by clicking Customize Filter. (See Creating Custom Filter Sets)

Creating Custom Filter Sets

The Customize Filter Sets dialog box allows you to create, remove or edit defined Filter Sets by changing their name, type or active Filters. When you create a new filter, the filter appears in the list of filters in the combo box.

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

To create custom filters, name your custom filter and choose any combination of filters from the list of Global Filters. You can add, delete and modify the Global Filters in the Edit Global Filters dialog by clicking Edit Global Filters. Note that each Filter Set or Filter has to have a unique name.

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

Depending on the size of the selected subset, the reduction in the overhead when profiling a part compared with profiling the entire application can be dramatic. This is because the application spends less time generating the profiling data and the tool spends less time processing this data.

More CPU profiling options that affect profiling data collection are available in the Custom Profiling mode.

Getting accurate results

The Profiler takes advantage of Sun's HotSpot JVM. When running an application, a lot of Java bytecodes can get compiled into machine code (typically for compilation it's enough for a method to be executed a few thousand times). If any of the methods in the given call graph have previously been compiled into machine code, dynamic instrumentation may initially disturb execution of these methods quite noticeably. The reason for this is that when a method is instrumented and its original and modified bytecodes are hotswapped, the new code initially runs interpreted, as in the beginning of the application execution. It then can get compiled again under the standard policy. Furthermore, a temporary switch to interpretation may happen even to some methods that are not instrumented themselves, but call instrumented methods. For this reason, while Profiler is discovering the call graph, and for some time afterwards, the application may run considerably slower than normally and the CPU profiling results obtained during this period are not representative of its normal execution.

It is recommended that you run the application for some time after initiating the call graph instrumentation and then discard the already accumulated profiling results by choosing Profile > Reset Collected Results from the main menu or clicking

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

Reset Collected Results in the Profiler window. (For example, if it's a server-side application, you can make it process a few hundred or thousand requests.) Profiling results collected afterwards will match reality much better.

See also

  • Profiling Tasks
  • Custom Profiling
  • Instrumenting a root method

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

profiler help

  • Home
  • Getting Started
  • Profiling Tasks
  • Control Panel
  • Profiling Results
  • Additional notes

Home > Profiling Tasks

Analyze Code Fragment Performance

This command allows you to specify and to measure the time it takes to execute an arbitrary piece of code within one method, or the whole method. By analyzing a code fragment rather than the entire application, the profiling overhead is greatly reduced. The absolute results that you obtain in this mode are closest to the real runtime performance, since the instrumentation is the most lightweight.

How To Analyze Code Fragment Performance

  1. Choose Profile -> Profile Main Project (
    netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help
    ) from the main menu.
  2. Select Analyze Code Fragment Performance in the Select Profiling Task dialog box.
  3. Click the Select Code Fragment button to open the Specify Code Fragment dialog box.
  4. Click the Select button and locate the class containing the fragment you would like to analyze.
  5. Do one of the following:
    • Select Whole Method and choose a method from the list in the combo box
    • Select Part of Method Code and enter the lines of the source code to profile
  6. Click OK.
  7. Click Run at the bottom of the dialog box to launch the application and start the task.

When you click Run, the target application launches and the Analyze Code Fragment Performance command starts.

To display profiling results, click the Live Results button (

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

) in the Profiler window. The results are displayed in the Code Fragment tab in the Profiling Results tab.

(Click here to see an example of the Code Fragment tab results.)

How To Specify a Code Fragment Using the Contextual Menu

You can specify a fragment using the contextual menu item Tools -> Add as a Profiling Code Fragment in the Projects Window. When you specify the code fragment in this way, you can choose to add it to the settings configuration for Analyze Performance: Code Fragment, or add it to a new settings configuration to be used in Custom Profiling.

  1. In the Projects Window, locate the method which contains the code fragment you want to instrument
  2. Right-click on the method in the Projects window
  3. Choose Tools -> Add as Profiling Code Fragment from the contextual menu

    This opens the Select Settings Configuration dialog box

  4. In the Select Settings Configuration dialog box, choose one of the configuration settings or create a new one by selecting "<Create new configuration>"

The class and its methods now appear in the pull-down lists in the Specify Code Fragment dialog box when you choose Analyze Code Fragment Performance, as well as in the list of code fragments in Custom Profiling -> Profile CPU -> Code Fragment.

See also

  • Profiling Tasks
  • Custom Profiling
  • Profiling Results - Code Fragment

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

profiler help

  • Home
  • Getting Started
  • Profiling Tasks
  • Control Panel
  • Profiling Results
  • Additional notes

Home > Profiling Tasks

Analyze Memory Usage

The Analyze Memory Usage task gives you data on objects that have been allocated in the target application.

How to profile Memory Usage

  1. Choose Profile -> Profile Main Project (
    netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help
    ) from the main menu.
  2. Select Analyze Memory Usage.
  3. Select one of the following profiling options:
    • Record object creation
    • Record both object creation and garbage collection
    (For more information on these options, see below)
  4. Click Run at the bottom of the dialog box to launch the application and start the task.

To display profiling results, click the Live Results button (

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

) in the Profiler window. The results are displayed in the Profiling Results tab.

Memory Profiling options

There are two predefined profiling options:

  • Record object creation (Object Allocation Profiling)

    This option gives you information about the number, type, and location of objects that have been allocated. Once you enable Object Allocation profiling, all classes currently loaded by the target JVM (and each new class as it is loaded) are instrumented to produce information about object allocations. The results are displayed in the Object Allocations tab

  • Record both object creation and garbage collection (Object Liveness Profiling)

    This option provides additional information about how many objects of each type are still alive, as well as data on live objects. The results are displayed in the Object Liveness tab

The first profiling mode is a functional subset of the second. The reason for having both is that pure object allocation profiling has a smaller performance and memory overhead.

See also

  • Profiling Tasks
  • Custom Profiling
  • Profiling Results - Memory Usage
  • Memory Snapshot

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

profiler help

  • Home
  • Getting Started
  • Profiling Tasks
  • Control Panel
  • Profiling Results
  • Additional notes

Home > Profiling Tasks

Run Custom Profiling

In Custom Profiling mode, you have complete control over all of the internal profiling settings available. You start custom profiling by choosing the Run Custom Profiling from the Select Profiling Task dialog box.

Custom Profiling Configurations

You can create, store and assign names to separate sets of custom profiling settings in individual profiling configurations. These configurations are automatically saved between IDE work sessions so that they can be reused and can be named.

When you select Run Custom Profiling, the box expands to display a list of the existing configurations. You can select and run a configuration from the list, create a new custom configuration or edit an existing configuration.

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

To Run a Custom Configuration

  1. Select Run Custom Profiling in the Select Profiling Task dialog box.
  2. Select one of the following profiling options:
    • Run an existing configuration

      Select a configuration from the list and click Run.

    • Create a new configuration

      Click New to bring up the New Custom Profiling box.

    • Edit an existing configuration

      Select an existing configuration and click Edit to bring up the Edit Custom Profiling box.

    For more on these options, see Editing and Creating Custom Profiling Configurations.
  3. Click Run at the bottom of the dialog box to launch the application and start the task.

To display profiling results, click the Live Results button (

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

) in the Profiler window or choose Profile > Get Current Results from the main menu. The results are displayed in the Profiling Results tab.

See also

  • Profile Class Dialog Box
  • Editing and Creating Custom Profiling Configurations

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>>

profiler help

  • Home
  • Getting Started
  • Profiling Tasks
  • Control Panel
  • Profiling Results
  • Additional notes

Home

Profiling Results

Profiling results are displayed in the Profiling Results tab in the Source Editor window.

The results displayed depend upon the profiling task selected.

  • Memory Usage

    When you profile memory usage, the Profiling Results tab shows data on object creation and allocation. To profile memory usage, choose Analyze Memory Usage or select Memory Profiling in the Custom Profile.

  • Application Performance

    When you profile application performance, the Profiling Results tab shows the total execution time and number of invocations for each method. To profile application performance, choose Analyze Performance or select CPU Profiling in the Custom Profile.

  • Code Fragment Performance

    When you analyze code fragment performance, the results in the Profiling Results tab displays the time it takes to execute an piece of code within one method, or the whole method.

Profiling Results tab

To open the Profiling Results tab, click the Live Results button (

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

) in the Profiler window.

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

Profiling Results Toolbar

The buttons on the Profiling Results toolbar enable you to perform the following basic tasks:

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

Autorefresh

Clicking this button starts the Autorefresh feature. When Autorefresh is on, the displayed profiling results are automatically updated at short intervals (about 2 seconds). Click the button again to turn off the feature.

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

Take Snapshot

Clicking this button takes a snapshot of the current profile data. When you take a snapshot, the snapshot is opened in a new tab in the Source Editor.

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

Reset Collected Results

Clicking this button discards the already accumulated profiling results.

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

Run GC

Clicking this button runs the garbage collection task.

Filtering results

The filter box at the bottom of the Profiling Results tab enables you to filter the displayed results according to the name of the method. To filter the results, enter a term in the method name filter box, select which filtering method to use and press Return. You can see and select previous filter terms by clicking the arrow to the right of the method name filter box.

To restore the full unfiltered list of methods, click Clear Filter ( 

netbeans profiler 5.0使用说明profiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler helpprofiler help

 ) to the right of the method name filter box.

继续阅读