blob: ca726f7a271d9818ba2a457593c1b960e3f64e42 [file] [log] [blame]
<!doctype html>
<html class="no-js" lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Profiling an Enterprise Application in NetBeans IDE</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Profiling an Enterprise Application in NetBeans IDE - Apache NetBeans">
<meta name="author" content="Apache NetBeans">
<meta name="description" content="Profiling an Enterprise Application in NetBeans IDE - Apache NetBeans">
<meta name="keywords" content="Apache NetBeans, Tutorials, Profiling an Enterprise Application in NetBeans IDE">
<meta name="generator" content="Apache NetBeans">
<link rel="stylesheet" href="../../../../../../_/css/font-awesome.min.css">
<link rel="alternate" type="application/atom+xml" title="Apache NetBeans Blog" href="https://netbeans.apache.org/blogs/atom" />
<link rel="stylesheet" href="../../../../../../_/css/highlightjs/default.min.css">
<link rel="stylesheet" href="../../../../../../_/css/netbeans.css">
<link rel="apple-touch-icon" sizes="180x180" href="../../../../../../_/images/fav/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="../../../../../../_/images/fav/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="../../../../../../_/images/fav/favicon-16x16.png">
<link rel="manifest" href="../../../../../../_/images/fav/site.webmanifest">
<link rel="mask-icon" href="../../../../../../_/images/fav/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#ffc40d">
<meta name="theme-color" content="#ffffff">
<link href="../../../../../../_/css/font-open-sans.css" rel="stylesheet">
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
</head>
<body>
<div class="title-bar" data-responsive-toggle="responsive-menu" data-hide-for="medium">
<button type="button" data-toggle="responsive-menu"><i style='font-size: 32px; color: #fff; padding: 8px' class='fa fa-bars'></i></button>
<div class="title-bar-title">Apache NetBeans</div>
</div>
<div class="top-bar" id="responsive-menu">
<div class='top-bar-left'>
<a class='title' href="../../../../../../index.html"><img src='../../../../../../_/images/apache-netbeans.svg' style='padding: 8px; height: 48px;'> Apache NetBeans</a>
</div>
<div class="top-bar-right">
<ul class="vertical medium-horizontal menu" data-responsive-menu="drilldown medium-dropdown">
<li> <input id="search-input" type="text" placeholder="Search the docs"> </li>
<li> <a href="../../../../../../front/main/community">Community</a> </li>
<li> <a href="../../../../../../front/main/participate">Participate</a> </li>
<li> <a href="../../../../../../front/main/blogs">Blog</a></li>
<li> <a href="../../../../../../front/main/help">Get Help</a> </li>
<li> <a href="https://plugins.netbeans.apache.org/">Plugins</a> </li>
<li> <a href="../../../../../../front/main/download">Download</a> </li>
</ul>
</div>
</div>
<!-- src/templates/news -->
<section class="hero news alternate">
<div class='grid-container'>
<div class='cell'>
<div class="annotation">Latest release</div>
<h1>Apache NetBeans 28</h1>
<p><a class="button success" href="../../../../../../front/main/download/nb28">Download</a></p>
</div>
</div>
</section>
<div class='grid-container main-content tutorial'>
<article class="doc">
<h1 class="sect0">Profiling an Enterprise Application in NetBeans IDE</h1>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon"><i class="fa icon-note" title="Note"></i></td>
<td class="content">This tutorial needs a review.
You can <a href="https://github.com/apache/netbeans-antora-tutorials/edit/main/modules/ROOT/pages/kb/docs/javaee/profiler-javaee.adoc" title="Edit this tutorial in github">edit it in GitHub </a>
following these <a href="../../../../../../tutorial/main/kb/docs/contributing">contribution guidelines.</a></td>
</tr></tbody>
</table>
</div>
</div>
<div id="toc" class="toc">
<div id="toctitle"></div>
<ul class="sectlevel1">
<li><a href="#_about_profiling_enterprise_applications_in_the_ide">About Profiling Enterprise Applications in the IDE</a>
<ul class="sectlevel2">
<li><a href="#_profiling_enterprise_application_projects">Profiling Enterprise Application Projects</a></li>
<li><a href="#_profiling_ejb_and_web_module_subprojects">Profiling EJB and Web Module Subprojects</a></li>
</ul>
</li>
<li><a href="#_creating_the_sample_project">Creating the Sample Project</a></li>
<li><a href="#_monitoring_the_application">Monitoring the Application</a></li>
<li><a href="#_analyzing_the_performance_of_the_application">Analyzing the Performance of the Application</a>
<ul class="sectlevel2">
<li><a href="#_sampling_the_application">Sampling the Application</a></li>
<li><a href="#_instrumenting_all_methods">Instrumenting All Methods</a></li>
<li><a href="#_using_profiling_root_methods">Using Profiling Root Methods</a></li>
<li><a href="#_using_instrumentation_filters">Using Instrumentation Filters</a></li>
</ul>
</li>
<li><a href="#_analyzing_memory_usage_of_the_application">Analyzing Memory Usage of the Application</a></li>
<li><a href="#_see_also">See Also</a></li>
</ul>
</div>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>NetBeans IDE includes a powerful profiling tool that can provide important information about the runtime behavior of enterprise applications. Using the profiling tool you can easily monitor thread states and obtain data on the CPU performance and memory usage of an application.</p>
</div>
<div class="paragraph">
<p>In this document you will use the profiling tool to obtain data about a simple enterprise application that is deployed as an WAR to an application server. This document shows how to use the IDE to obtain profiling results about the following.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Runtime behavior of an application</p>
</li>
<li>
<p>CPU time used by an application&#8217;s methods</p>
</li>
<li>
<p>Object creation</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>If you are deploying an application to a local registered Tomcat, GlassFish server or JBoss installation, you can profile the application with only a few mouse clicks and almost zero configuration. The process of profiling the project is very similar to using the Run command in the IDE. You can easily start profiling enterprise application projects or individual web and EJB modules by choosing Profile &gt; Profile Main Project from the main menu.</p>
</div>
<div class="paragraph">
<p><strong>To follow this tutorial, you need the following software and resources.</strong></p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Software or Resource</th>
<th class="tableblock halign-left valign-top">Version Required</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../../../../../../front/main/download/" class="xref page">NetBeans IDE</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">7.3, 7.4, 8.0, Java EE bundle</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Java Development Kit (JDK)</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">JDK 7 or 8</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">GlassFish server</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">3.1, 4.0</p></td>
</tr>
</tbody>
</table>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="ulist">
<ul>
<li>
<p>If you are using the profiler for the first time, it is recommended that you read the <a href="../../java/profiler-intro/" class="xref page">Introduction to Profiling Java Applications in NetBeans IDE</a> which provides an overview of the monitoring and profiling tasks.</p>
</li>
<li>
<p>In this document you will profile an enterprise application deployed to the GlassFish server. The preferred and the easiest configuration for profiling an enterprise or web application during development is when the the application is running on a local Tomcat, GlassFish or JBoss server.</p>
</li>
</ul>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_about_profiling_enterprise_applications_in_the_ide"><a class="anchor" href="#_about_profiling_enterprise_applications_in_the_ide"></a>About Profiling Enterprise Applications in the IDE</h2>
<div class="sectionbody">
<div class="paragraph">
<p>When profiling enterprise applications, in most cases you will want to analyze the performance of the application to see the execution time of the project&#8217;s methods. This enables you to troubleshoot the application and try to improve the performance. In some cases you will also want to obtain data on memory usage to optimize garbage collection.</p>
</div>
<div class="paragraph">
<p>The process for profiling enterprise applications, EJB modules and web applications is basically the same as for running the project using the Run command. After selecting the profiling task and specifying profiling options, you click Run in the Select Profiling Task dialog box to start the profiling session. When you start a profiling session, the IDE does the following:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Compiles the application</p>
</li>
<li>
<p>Starts the target server in profiling mode</p>
</li>
<li>
<p>Deploys the application</p>
</li>
<li>
<p>Attaches to the application</p>
</li>
<li>
<p>Opens the web browser to the web page (if specified in project properties)</p>
</li>
<li>
<p>Opens the Live Profiling Results tab</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Depending on your profiling options, the IDE will immediately start displaying profiling results in the Live Profiling Results tab. In some cases, such as when you have specified profiling root methods, you may need to perform some actions in the web browser before results are displayed.</p>
</div>
<div class="sect2">
<h3 id="_profiling_enterprise_application_projects"><a class="anchor" href="#_profiling_enterprise_application_projects"></a>Profiling Enterprise Application Projects</h3>
<div class="paragraph">
<p>An enterprise application that you create in the IDE will typically be either a web application project that is deployed to an application server as a web archive (WAR) or an enterprise application project that contains a web application and additional libraries and is deployed as an enterprise application archive (EAR).</p>
</div>
<div class="paragraph">
<p>If you want to deploy your application as an EAR archive, you can create a NetBeans enterprise application project that contains the sub-projects and libraries. The enterprise application project does not contain any source files, only information about building and deploying the application and server configuration metadata. In an enterprise application project, the business logic of the application is generally contained in the EJB module and the source code for the presentation layer is contained in the web module.</p>
</div>
<div class="paragraph">
<p>If you have all the sources for the enterprise application project, the best and easiest method for profiling the application is to profile the enterprise application project rather than one of the project&#8217;s sub-projects. This ensures that all the necessary code is compiled and deployed and that the application behaves correctly. You can profile an enterprise application project by doing either of the following:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>If the enterprise application project is set as the Main Project, click Profile Main Project from the IDE toolbar or choose Profile &gt; Profile Main Project in the main menu.</p>
</li>
<li>
<p>Right-click the enterprise application project node in the Projects window and choose Profile from the popup menu.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>When profiling an enterprise application, you can increase the relevance of the profiling results by specifying profiling root methods and using instrumentation filters to limit the classes that are profiled. This can help minimize the impact that the profiling overhead imposes on the performance of the application and increase the relevance of the profiling results.</p>
</div>
<div class="paragraph">
<p>Unlike web applications, when you run an enterprise applications the browser is not always opened automatically. (This depends on the project configuration.) This means that in some cases you may need to manually launch the web application front end and then invoke code such as the business logic in an EJB module from the web browser.</p>
</div>
</div>
<div class="sect2">
<h3 id="_profiling_ejb_and_web_module_subprojects"><a class="anchor" href="#_profiling_ejb_and_web_module_subprojects"></a>Profiling EJB and Web Module Subprojects</h3>
<div class="paragraph">
<p>You can start a profiling session from any EJB module or web module project. In this case, you may want to try one of the following approaches:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Profiling an EJB module.</strong> If you take this approach, you will probably need to invoke the application code manually from the web browser or another client because EJB module projects are generally not configured to open a web browser. After the EJB module is deployed to the server, you should invoke its code the same way as you would for debugging or evaluating application functionality, typically by launching the web application front end and then performing actions in the web browser.</p>
</li>
<li>
<p><strong>Profiling a web module.</strong> If you take this approach you will need to compile and deploy the EJB module to the server before profiling the web module project. Typically, the EJB&#8217;s code is performed as a result of some user action in a browser. If this action is performed/handled by the web application code, you will see the EJB code in its call tree.</p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_creating_the_sample_project"><a class="anchor" href="#_creating_the_sample_project"></a>Creating the Sample Project</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In this document you will profile the ServletStateless sample application. The ServletStateless application is a simple enterprise web application that is included as a sample project in the IDE.</p>
</div>
<div class="paragraph">
<p>To create the ServletStateless application, perform the following steps.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Choose File &gt; New Project (Ctrl-Shift-N; ⌘-Shift-N on Mac) from the main menu.</p>
</li>
<li>
<p>In the New Projects wizard, select the Samples &gt; Java EE category.</p>
</li>
<li>
<p>Select the Servlet Stateless project. Click Next.</p>
</li>
<li>
<p>Specify a location for the project. Click Finish.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>When you click Finish, the IDE creates the ServletStateless sample project. You can see the ServletStateless project in the Projects window.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="ulist">
<ul>
<li>
<p>By default, when using the IDE to profile a project, the IDE will profile the project that is selected in the Projects window if more than one project is open. If you choose Run &gt; Set Main Project from the main menu and set a project as the Main Project, the Main Project is profiled by default. You can right-click a project node in the Projects window and choose Profile in the popup menu.</p>
</li>
<li>
<p>If you want to profile a file such as <code>.jsp</code> page or a servlet, right-click the file and choose Profile File from the popup menu. The behavior is similar to Profile (Main) Project, but when you start the profiling session the selected web page will open in the browser instead of the default web page for the project.</p>
</li>
</ul>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_monitoring_the_application"><a class="anchor" href="#_monitoring_the_application"></a>Monitoring the Application</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Monitoring an application enables you to obtain high-level information about properties of the target JVM, including thread activity and memory allocations. Because monitoring an application imposes very low overhead, you can run the application in this mode for extended periods of time. When you choose the Monitor task, the target application is started without any instrumentation.</p>
</div>
<div class="paragraph">
<p>To monitor the ServletStateless application perform the following steps.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Choose Run &gt; Set Main Project &gt; ServletStateless to set the project as the main project.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>When you set the project as the Main Project the name of the project will be in bold in the Projects window.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Choose Profile &gt; Profile Main Project from the main menu.</p>
</li>
</ol>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Select JDK 1.7 or JDK 1.8 if you are prompted to select a Java platform for profiling.
</td>
</tr>
</table>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Select Monitor in the Select Profiling Task dialog box.</p>
</li>
<li>
<p>Click Run.</p>
</li>
</ol>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If you have not used the profiler before you might be prompted to calibrate the profiler before you can click Run. For more on calibrating the profiler, see the section on <a href="../../java/profiler-intro/#calibrate" class="xref page">Using the Profiler for the First Time</a> in the <a href="../../java/profiler-intro/" class="xref page">Introduction to Profiling Java Applications in NetBeans IDE</a>.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>When you click Run, the IDE builds the application, starts the server in profile mode and then deploys the application to the server. The IDE then attaches to the application and starts retrieving data.</p>
</div>
<div class="paragraph">
<p>Data on threads in the target JVM is displayed in the Threads tab. The Threads tab displays data on all threads, server threads as well as threads in the application.</p>
</div>
<div class="paragraph">
<p>You can view additional monitoring information by clicking the Telemetry Overview button in the Profiler window to open the VM Telemetry Overview window. The VM Telemetry Overview window enables you to quickly get an overview of the monitoring data in real time. You can double-click any of the graphs in the VM Telemetry Overview window to open a larger version of the graph.</p>
</div>
<div class="paragraph">
<p>When monitoring an enterprise application, the Memory(Heap) and Memory (GC) graphs can help you quickly see the memory usage of the application. You can place your cursor over the graph to open a tooltip with more detailed information. If the heap size or the number of surviving generations is steadily increasing, it could indicate a memory leak. If you suspect a memory leak, you may then want to profile the application&#8217;s memory usage.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/monitor-memory-telemetry.png" alt="monitor memory telemetry">
</div>
<div class="title">Figure 1. Memory (GC) graph showing the GC information</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_analyzing_the_performance_of_the_application"><a class="anchor" href="#_analyzing_the_performance_of_the_application"></a>Analyzing the Performance of the Application</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Analyze CPU Performance task enables you to see data on the method-level CPU performance (execution time) of your application and the number of times methods are invoked. You can choose to analyze the performance of the entire application or select a profiling root to limit the profiling to a part of the application code.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/sample-task.png" alt="sample task">
</div>
<div class="title">Figure 2. Sample Application mode selected in the CPU pane of Select Profiling Task dialog box</div>
</div>
<div class="paragraph">
<p>When you choose the analyze CPU performance task in the Profiling Tasks window you can choose how much of the application you want to profile by selecting one of the following options.</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Quick (sampled).</strong> In this mode, the IDE samples the application and takes a stack trace periodically. This option is less precise than instrumenting methods, but the overhead is lower. This option can help you locate methods that you might want to instrument.</p>
</li>
<li>
<p><strong>Advanced (instrumented).</strong> In this mode, the methods of the profiled application are instrumented. The IDE records when threads enter and exit project methods enabling you to see how much time is spent in each method. When entering a method, threads generate a "method entry" event. Threads generate a corresponding "method exit" event when exiting the method. The timestamps for both of these events are recorded. This data is processed in real time.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>You can choose to instrument all the methods in the application or limit the instrumentation to a subset of the application&#8217;s code by specifying one or more <strong>root methods</strong>. Specifying a root method can greatly reduce the profiling overhead. A root method is the method, class or package in your source code that you specify as an instrumentation root. Profiling data is collected when one of the application&#8217;s threads enters and leaves the instrumentation root. No profiling data is collected until one of the application&#8217;s threads enters the root method. You can specify a root method using the popup menu in the source code or by clicking <strong>customize</strong> to open the Edit Profiling Roots dialog box.</p>
</div>
<div class="paragraph">
<p><strong>Tips for Profiling Web Applications</strong></p>
</div>
<div class="ulist">
<ul>
<li>
<p>In addition to the Java core classes, an enterprise application will typically invoke a number of methods in classes in the target server. For this reason it is important to choose a filter to limit the sources that are instrumented. It is recommended that you use the <strong>Profile only project classes</strong> filter when profiling enterprise applications.</p>
</li>
<li>
<p>Profiling results are collected as soon as the profiling session is started. If you are using the Advanced method and you do not specify any profiling root methods, some interesting data is available immediately after server startup, specifically the web application&#8217;s listeners and filters initialization. If you specify some profiling root methods you probably will not get this data, depending on the root methods that you select.</p>
</li>
<li>
<p>Usually you are not interested in data about listeners or filters, so you can click Reset Collected Results to clear that data. The first usable data will be collected after some code is invoked as a result of some action in the web browser, typically displaying a JSP page that uses JavaBeans and/or custom tags or processing servlet&#8217;s <code>doGet</code> / <code>doPost</code> method. You should note that the data collected when the application starts up the first time often only represents the startup behavior of the web application.</p>
</li>
<li>
<p>If a JSP page is being displayed for the first time, it is compiled to the servlet internally by the server, which affects the call tree and the methods timing. Also, the behavior of servlets and other application code can be slightly different during the first run than it is in a real production environment, where the application is running constantly. To obtain profiling data that better represents real application performance, you should generate some workload on the profiled code before measuring any times (call trees should not be affected by this). You can use a load generators to help you with this. (For more, see <a href="../../java/profile-loadgenerator/" class="xref page">Using a Load Generator in NetBeans IDE</a>.) The caching capabilities of various browsers can also have an impact on performance.</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If you are profiling web applications on the GlassFish application server on a Windows machine, starting the server for profiling may fail if the NetBeans IDE is installed in a path that contains spaces (such as the default installation to <code>C:\Program Files\netbeans-7.4</code> ). The workaround is to install/copy your NetBeans IDE installation directory to a location that does not contain spaces in the path (such as <code>C:\netbeans-7.4</code> ).
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="_sampling_the_application"><a class="anchor" href="#_sampling_the_application"></a>Sampling the Application</h3>
<div class="paragraph">
<p>You should choose the Quick option if you need an overview of the behavior of the entire application and you do not want to instrument the methods. In the Quick profile mode the IDE periodically takes a stack trace. The overhead of the Quick profile mode is less than the Advanced profile mode.</p>
</div>
<div class="paragraph">
<p>In this exercise you will analyze the performance of the application by selecting the Quick profile mode.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Stop the monitoring session by clicking the Stop button in the Profiler window.</p>
</li>
<li>
<p>Choose Profile &gt; Profile Main Project from the main menu.</p>
</li>
<li>
<p>Select CPU in the Select Profiling Task dialog box.</p>
</li>
<li>
<p>Select the <strong>Quick (sampled)</strong> mode.</p>
</li>
<li>
<p>Select <strong>Profile only project classes</strong> from the Filter drop-down list. Click Run.</p>
</li>
</ol>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
This filter will limit the classes that are instrumented to the classes that are found in the enterprise application project. Click <strong>Show filter value</strong> to see a list of the filtered classes.
</td>
</tr>
</table>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/sample-task.png" alt="sample task">
</div>
<div class="title">Figure 3. Sample Application mode selected in the CPU pane of Select Profiling Task dialog box</div>
</div>
<div class="paragraph">
<p>You can see on the scale in the dialog that the overhead will be relatively low.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Click the Live Profiling Results button in the Profiler window to open the Live Profiling Results tab.</p>
</li>
</ol>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/sample-task-results.png" alt="sample task results">
</div>
<div class="title">Figure 4. Results of Sample Application mode</div>
</div>
<div class="paragraph">
<p>In the Live Profiling Results tab you can see the execution time for the <code>service</code> method for the servlet in the <code>Servlet2Stateless</code> class and that the method was invoked one time.</p>
</div>
</div>
<div class="sect2">
<h3 id="_instrumenting_all_methods"><a class="anchor" href="#_instrumenting_all_methods"></a>Instrumenting All Methods</h3>
<div class="paragraph">
<p>In the Profile Application mode, the methods of your application are instrumented. Though you get a more exact measurement of the performance of the application, the profiling overhead is higher than if you choose the sample mode. You can specify profiling root methods to limit the methods that are instrumented and reduce the profiling overhead. For some applications, specifying a root method may be the only way to obtain any detailed and/or realistic performance data because profiling the entire application may generate so much profiling data that the application becomes unusable or may even cause the application to crash.</p>
</div>
<div class="paragraph">
<p>In this exercise you will analyze the performance of the application by instrumenting all the methods in the enterprise application.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Stop the monitoring session by clicking the Stop button in the Profiler window.</p>
</li>
<li>
<p>Choose Profile &gt; Profile Main Project from the main menu.</p>
</li>
<li>
<p>Select CPU in the Select Profiling Task dialog box.</p>
</li>
<li>
<p>Select the <strong>Advanced (instrumented)</strong> mode.</p>
</li>
<li>
<p>Select <strong>Profile only project classes</strong> from the Filter drop-down list. Click Run.</p>
</li>
</ol>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/advanced-cpu-task.png" alt="advanced cpu task">
</div>
<div class="title">Figure 5. Profile Application mode selected in the CPU pane of Select Profiling Task dialog box</div>
</div>
<div class="paragraph">
<p>You can see on the scale in the dialog that the overhead will be higher than in the Quick profile mode.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Click the Live Profiling Results button in the Profiler window to open the Live Profiling Results tab.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>You can see that the Live Profiling Results tab shows the execution time for the <code>init</code> and <code>service</code> methods for the servlet in the <code>Servlet2Stateless</code> class and that each method was invoked one time. The <code>init</code> method in the <code>StatelessSessionBean</code> class was also invoked.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/cpu-pane1-results.png" alt="cpu pane1 results">
</div>
<div class="title">Figure 6. Results of Profile Application mode</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
By default, the auto-refresh mode is active so that the data displayed is refreshed every few seconds. You can activate and de-activate the auto-refresh mode by clicking the Auto-Refresh button in the toolbar.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>To improve the readability of the collected data, you can use the Results filter in the Hot Spots view in the Live Profiling Results window to filter the displayed results. The Results filter only filters the display of results and does not affect the classes that are instrumented. When you use the Results filter, you filter the results which start, contain or end with a defined pattern. You can also use more complex regular expressions for filtering. Data is filtered based on package/class/method names exactly as they appear in the first results table column. You can specify more than one pattern, separating the patterns by a space or comma with space.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>In the web browser, type your name in the field and click Submit Query.</p>
</li>
</ol>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/cpu-pane1-results1.png" alt="cpu pane1 results1">
</div>
<div class="title">Figure 7. Results of Profile Application mode</div>
</div>
<div class="paragraph">
<p>When you click Submit Query, you can see that the Live Profiling Results tab is updated to reflect the action in the web browser. Clicking the button invoked the <code>sayHello</code> method in the <code>StatelessSessionBean</code> class and invoked the <code>init</code> method again. The <code>service</code> method for the servlet in the <code>Servlet2Stateless</code> was also invoked again. The tab also displays how much time was spent in each of the methods.</p>
</div>
<div class="paragraph">
<p>You can click the DrillDown button to see a graphic representation of the relative time spent in various areas of the application, for example, servlets, listeners, etc. You can click on the graphic to drill down into the displayed profiling results.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/drill-down.png" alt="drill down">
</div>
<div class="title">Figure 8. Drilldown graph of relative time spent in servlets in the application</div>
</div>
<div class="paragraph">
<p>Instrumenting an application will always impose some overhead when profiling the application. In such a simple application the overhead is not noticeable, but in a complex application the overhead can be quite significant. You can reduce the overhead by limiting the classes that are profiled by selecting a profiling root method.</p>
</div>
</div>
<div class="sect2">
<h3 id="_using_profiling_root_methods"><a class="anchor" href="#_using_profiling_root_methods"></a>Using Profiling Root Methods</h3>
<div class="paragraph">
<p>In this exercise you will profile only part of the application. You should use this profiling method if you think you know where a performance bottleneck is, or if you want to profile some specific part of your code, such as only one or a few servlets. This method typically imposes significantly lower profiling overhead than instrumenting all the application methods. By instrumenting only part of the application, only the data you are really interested in is collected and displayed.</p>
</div>
<div class="paragraph">
<p>To profile part of an application you need to set one or more profiling root methods. The IDE instruments only those methods that are called by a thread entering a profiling root method. For example, if you set the <code>sayHello</code> method in the <code>StatelessSessionBean</code> class as the root method and use the Profile only project classes filter, the IDE will start instrumenting methods when the method is invoked and an application thread enters the method. In this application the <code>init</code> constructor will not be instrumented because it is invoked before <code>sayHello</code> .</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/profileroot-sayhello-project.png" alt="profileroot sayhello project">
</div>
<div class="title">Figure 9. Drilldown graph of relative time spent in servlets in the application</div>
</div>
<div class="paragraph">
<p>If you select the Profile all classes filter the IDE will instrument all methods called by <code>sayHello</code> , including any Java core classes.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/profileroot-sayhello-all.png" alt="profileroot sayhello all">
</div>
<div class="title">Figure 10. Drilldown graph of relative time spent in servlets in the application</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
In a more complex application you may want to specify several root methods. You can select individual methods, entire classes and packages as profiling roots.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>To specify a profiling root and analyze the performance of the application, perform the following steps.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Stop the previous profiling session (if still running) by clicking the Stop button in the Profiler window.</p>
</li>
<li>
<p>Choose Profile &gt; Profile Main Project from the main menu.</p>
</li>
<li>
<p>Select CPU in the Select Profiling Task dialog box.</p>
</li>
<li>
<p>Select the <strong>Advanced (instrumented)</strong> mode.</p>
</li>
<li>
<p>Click <strong>customize</strong> to open the Edit Profiling Roots dialog box.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>To profile part of an application you need to first specify the root methods. By selecting the profiling root, you limit the profiling to the methods called by the thread entering the profiling root.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>In the Edit Profiling Roots dialog box, select Web Application View in the Select View drop-down list.</p>
</li>
<li>
<p>Expand the ServletStateless node and select the <code>service</code> method in the Servlets package. Click OK.</p>
</li>
</ol>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/edit-profiling-roots.png" alt="edit profiling roots">
</div>
<div class="title">Figure 11. Web Application View in Edit Profiling Roots dialog</div>
</div>
<div class="paragraph">
<p>Alternatively, you can choose the Package View to view all the source packages in the application and select the <code>service</code> method in the <code>Servlet2Stateless</code> class in the <code>servlet.stateless</code> package.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/edit-profiling-roots-pkg.png" alt="edit profiling roots pkg">
</div>
<div class="title">Figure 12. Package View in Edit Profiling Roots dialog</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Notice that the <code>Servlet2Stateless</code> constructor is not selected. You can use the Edit Profiling Roots dialog to limit the instrumentation to specific methods in a class. If you do not want to limit the instrumentation to specific methods, you can use the Package View to select an entire class or package. For example, if you select the <code>Servlet2Stateless</code> class in the Package View of the Edit Profiling Roots dialog box, the IDE will instrument the <code>init</code> constructor and the <code>service</code> method.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>If you click the Advanced button you can see that the <code>service</code> method is listed as the only root method in the Edit Profiling Roots (Advanced) dialog box. You can click Add to explicitly define a method by typing the method signature and class.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/edit-profilingroots-pkg-adv.png" alt="edit profilingroots pkg adv">
</div>
<div class="title">Figure 13. Edit Profiling Roots (Advanced) dialog</div>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Click OK in the Edit Profiling Roots dialog box.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>In the Select Profiling Task dialog box you can see that the Advanced profiling mode will be run using custom profiling roots. You can click <strong>edit</strong> to view and modify the selected root methods. Notice that the profiling overhead is now less than when no root methods were specified.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Select <strong>Profile only project classes</strong> from the Filter drop-down list. Click Run.</p>
</li>
</ol>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/advanced-cpu-task-custom.png" alt="advanced cpu task custom">
</div>
<div class="title">Figure 14. Profile Application mode selected with a custom profiling root</div>
</div>
<div class="paragraph">
<p>When you click Run, the IDE builds and deploys the application and opens the web browser to the servlet page.</p>
</div>
<div class="paragraph">
<p>The IDE displays the profiling results in the Live Profiling Results tab.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/cpu-pane2-results.png" alt="cpu pane2 results">
</div>
<div class="title">Figure 15. Results of instrumenting methods using a profiling root</div>
</div>
<div class="paragraph">
<p>You can see that the IDE only displays the results for the method specified as the profiling root. The application thread has not entered any other methods in the application after entering the profiling root.</p>
</div>
<div class="paragraph">
<p>Though the application has entered other methods since entering the profiling root, these other methods are not displayed because the instrumentation filter limits the instrumentation to classes that are part of the project.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>In the web browser, type your name in the field and click Submit Query.</p>
</li>
</ol>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/cpu-pane2-results1.png" alt="cpu pane2 results1">
</div>
<div class="title">Figure 16. Results of instrumenting methods using a profiling root after invoking sayHello method</div>
</div>
<div class="paragraph">
<p>When you click Submit Query, you can see that the Live Profiling Results tab is updated to reflect the action in the web browser. Clicking the button invoked the <code>sayHello</code> method in the <code>StatelessSessionBean</code> class one time. The <code>service</code> method was also invoked again.</p>
</div>
<div class="paragraph">
<p>The results display the performance of the application, but may not accurately represent the performance of an application that has been running for some time. One way to emulate the performance of a web application under more realistic conditions is to run a load generator script.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Repeat the previous step a few times in the browser and then click Reset Results in the Live Profiling Results tab to clear the results.</p>
</li>
<li>
<p>After the profiling results are reset, type your name and click Submit Query one more time.</p>
</li>
</ol>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/cpu-pane2-results2.png" alt="cpu pane2 results2">
</div>
<div class="title">Figure 17. Results of instrumenting methods using a profiling root after invoking sayHello method</div>
</div>
<div class="paragraph">
<p>If you look at the profiling results, in many cases you may see that the performance has improved.</p>
</div>
</div>
<div class="sect2">
<h3 id="_using_instrumentation_filters"><a class="anchor" href="#_using_instrumentation_filters"></a>Using Instrumentation Filters</h3>
<div class="paragraph">
<p>When you are analyzing CPU performance you can reduce the profiling overhead by choosing an instrumentation filter from the drop-down list to limit profiling to the source code that you are interested in. You can use the filter to specify the packages/classes that are instrumented. You can choose from the following default filters or create a custom filter.</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Profile all classes.</strong> If you select this filter when profiling a web application or enterprise application, all classes including core Java classes and server classes are instrumented. You need to exercise caution if you choose this filter option because instrumenting so many classes can impose a <strong>very</strong> significant overhead .</p>
</li>
<li>
<p><strong>Profile only project classes</strong> If you are profiling an enterprise application it is recommended that you use this filter to limit the instrumented code to the classes in the project. Server classes will not be instrumented.</p>
</li>
<li>
<p><strong>Profile project and subproject classes.</strong> If you are profiling an enterprise application project that contains sub-projects such as a web application, EJB modules or class libraries, you can choose this filter to limit the instrumented code to the classes in the sub-projects.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>You can create custom filters to use in specific projects or for specific types of profiling. For example, if you want an instrumentation filter to use when profiling web applications on the Oracle WebLogic server, you can click "Edit filter sets" to create a filter set that excludes Java Core Classes, Oracle WebLogic Classes and NetBeans Classes (useful when HTTP Monitor is enabled). You can then give the filter set a name such as "WebLogic Webapp Exclusive" and then choose that filter from the Filter drop-down list when profiling applications deployed to the WebLogic server.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/custom-filter.png" alt="custom filter">
</div>
<div class="title">Figure 18. dialog box that appears when profiling a project for the first time</div>
</div>
<div class="paragraph">
<p>You can define a simple instrumentation filter by selecting Quick Filter from the Filter drop-down list to open the Set Quick Filter dialog box. You can then quickly edit the list of packages or classes that are instrumented. This creates a Quick Filter that you can then select from the Filter drop-down list.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/set-quick-filter.png" alt="set quick filter">
</div>
<div class="title">Figure 19. dialog box that appears when profiling a project for the first time</div>
</div>
<div class="paragraph">
<p>For more information about defining and using instrumentation filters, consult the profiling documentation in the IDE.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_analyzing_memory_usage_of_the_application"><a class="anchor" href="#_analyzing_memory_usage_of_the_application"></a>Analyzing Memory Usage of the Application</h2>
<div class="sectionbody">
<div class="paragraph">
<p>You can use the IDE&#8217;s profiling tool to analyze an enterprise application&#8217;s memory usage to obtain detailed data on object allocation and garbage collection. The Analyze Memory Usage task gives you data on objects that have been allocated in the target application such as the number, type and location of the allocated objects.</p>
</div>
<div class="paragraph">
<p>When profiling memory usage you cannot set the profiling root methods and/or instrumentation filters, so all objects created during the server&#8217;s life are tracked. This can lead to significant profiling overhead and memory consumption for complex application servers. Therefore you should be aware of the potential limitations of your machine before performing this type of profiling. To lower the profiling overhead, you can modify the setting so that only every 10th object is profiled. You may also want to disable (limit) the recording of stack traces for object allocations.</p>
</div>
<div class="paragraph">
<p>When profiling enterprise applications to detect memory leaks, using the metrics for Surviving Generations can be very useful. By tracking the number of various object generations surviving garbage collection cycles, the tool can help you to detect memory leaks early, before the application uses any noticeable amount of memory.</p>
</div>
<div class="paragraph">
<p>To analyze memory performance, you choose how much data you want to obtain by selecting one of the following options:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Quick.</strong> When this option is selected, the profiler samples the application to provide data that is limited to the live objects. Live objects are all the reachable (and unreachable) objects that have not been reclaimed by the Garbage Collector. This option only tracks live objects and does not track allocations when instrumenting. It is not possible to record stack traces or to use profiling points if you select this option. This option incurs a significantly lower overhead than the Advanced option.</p>
</li>
<li>
<p><strong>Advanced.</strong> When this option is selected you can obtain information about the number, type, and location of allocated objects. The allocated objects are the objects created since the application started (or since the Collected Results in the profiler was last reset). All classes that are currently loaded by the target JVM (and each new class as it is loaded) are instrumented to produce information about object allocations. You need to select this option if you want to use profiling points when analyzing memory usage or if you want to record the call stack. This options incurs a greater profiling overhead than the Quick option.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>If you select the Advanced option you can also set the following options.</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Record Full Object Lifestyle.</strong> Select this option to record all information for each object, including the number of generations survived.</p>
</li>
<li>
<p><strong>Record Stack Traces for Allocation.</strong> Select this option to record the full call stack. This option enables you to view the reverse call tree for method calls when viewing a memory snapshot.</p>
</li>
<li>
<p><strong>Use defined Profiling Points.</strong> Select this option to enable profiling points. Disabled profiling points are ignored. When deselected, all profiling points in the project are ignored.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The Overhead meter in the Select Profiling Tasks window gives a rough approximation of the increase or decrease in profiling overhead according to the profiling options that you select.</p>
</div>
<div class="paragraph">
<p>You will now use the IDE to analyze the memory performance of the enterprise application. If you want to obtain information about surviving generations you will need to choose the <strong>Advanced</strong> option. Alternatively, if you just want data about the live objects you can select the <strong>Quick</strong> option.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Stop the previous profiling session (if still running) by clicking the Stop button in the Profiler window.
When you click Stop, the IDE detaches from the application.</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Choose Profile &gt; Profile Main Project from the main menu.</p>
</li>
<li>
<p>Select <strong>Memory</strong> in the Select Profiling Task dialog box.</p>
</li>
<li>
<p>Select <strong>Advanced</strong>.</p>
</li>
<li>
<p>Select <strong>Record full object lifecycle</strong> to obtain data about surviving generations.</p>
</li>
</ol>
</div>
</li>
</ol>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If you select this option you will notice that the Overhead meter will increase substantially. When profiling an enterprise application, it is quite possible that you will need to increase the memory for the IDE because of the amount of collected data.
</td>
</tr>
</table>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Deselect <strong>Use defined Profiling Points</strong> (if selected). Click Run.</p>
</li>
</ol>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/profile-memory-advanced.png" alt="profile memory advanced">
</div>
<div class="title">Figure 20. Select Profiling Task dialog showing Memory task and options</div>
</div>
<div class="paragraph">
<p>When you click Run, the IDE compiles the application, starts the server in profile mode and deploys the application to the server. To view the profiling results, click Live Results in the Profiler window to open the Live Results window. The Live Results window displays information on the size and number of objects that are allocated on the target JVM. In addition to the objects allocated by the enterprise application, the results also include all the objects allocated by the application server.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../../../../_images/kb/docs/javaee/profile-memory-results.png" alt="profile memory results">
</div>
<div class="title">Figure 21. Profiling Results tab showing results of profiling memory usage</div>
</div>
<div class="paragraph">
<p>By default the results are sorted and displayed by the number of Live Bytes, but you can click a column header to change how the results are displayed. You can also filter the results by typing a class name in the filter box below the list.</p>
</div>
<div class="paragraph">
<p><a href="../../../../../../front/main/community/mailing-lists/" class="xref page">Send Feedback on This Tutorial</a></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_see_also"><a class="anchor" href="#_see_also"></a>See Also</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This document demonstrated basic approaches to obtaining profiling data when profiling an enterprise application that is deployed to the GlassFish application server.</p>
</div>
<div class="paragraph">
<p>For more detailed information about profiling settings and features not covered in this document, please consult the documentation included in the product and available from the Help menu item.</p>
</div>
<div class="paragraph">
<p>For related documentation, see the following resources:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="../../../../../../wiki/main/wiki/NetBeansUserFAQ/#section-NetBeansUserFAQ-Profiler" class="xref page">NetBeans Profiler FAQs</a>
A document containing frequently asked questions regarding profiling applications in NetBeans IDE</p>
</li>
<li>
<p><a href="../../../../../../wiki/main/wiki/FaqProfilerProfileFreeForm/" class="xref page">FAQ: Profiling a Free-form project</a></p>
</li>
<li>
<p><a href="../../java/profiler-screencast/" class="xref page">Screencast: Profiling Points, Drill Down Graph, Heap Walker</a>
Demo showing some of the profiling features in NetBeans IDE.</p>
</li>
<li>
<p><a href="../../../../../../front/main/community/magazine/html/04/profiler/" class="xref page">Advanced Profiling: Theory in Practice</a></p>
</li>
<li>
<p><a href="http://profiler.netbeans.org/index.html">profiler.netbeans.org</a>
The NetBeans profiler project site</p>
</li>
<li>
<p><a href="http://blogs.oracle.com/nbprofiler/">NetBeans Profiler blog</a></p>
</li>
<li>
<p><a href="http://profiler.netbeans.org/mailinglists.html">NetBeans Profiler Mailing Lists</a></p>
</li>
<li>
<p><a href="http://profiler.netbeans.org/docs/help/5.5/index.html">Using NetBeans Profiler 5.5</a></p>
</li>
</ul>
</div>
</div>
</div>
<section class='tools'>
<ul class="menu align-center">
<li><a title="Facebook" href="https://www.facebook.com/NetBeans"><i class="fa fa-md fa-facebook"></i></a></li>
<li><a title="Twitter" href="https://twitter.com/netbeans"><i class="fa fa-md fa-twitter"></i></a></li>
<li><a title="Github" href="https://github.com/apache/netbeans"><i class="fa fa-md fa-github"></i></a></li>
<li><a title="YouTube" href="https://www.youtube.com/user/netbeansvideos"><i class="fa fa-md fa-youtube"></i></a></li>
<li><a title="Atom Feed" href="https://netbeans.apache.org/blogs/atom"><i class="fa fa-mf fa-rss"></i></a></li>
<li><a title="Slack" href="https://tinyurl.com/netbeans-slack-signup/"><i class="fa fa-md fa-slack"></i></a></li>
<li><a title="Issues" href="https://github.com/apache/netbeans/issues"><i class="fa fa-mf fa-bug"></i></a></li>
</ul>
<ul class="menu align-center">
<li><a href="https://github.com/apache/netbeans-antora-tutorials/edit/main/modules/ROOT/pages/kb/docs/javaee/profiler-javaee.adoc" title="See this page in github"><i class="fa fa-md fa-edit"></i> See this page in GitHub.</a></li>
</ul>
</section>
</article>
</div>
<div class='grid-container incubator-area' style='margin-top: 64px'>
<div class='grid-x grid-padding-x'>
<div class='large-auto cell text-center'>
<a href="https://www.apache.org/">
<img style="height: 60px" title="Apache Software Foundation" src="../../../../../../_/images/asf_logo_wide.svg" />
</a>
</div>
<div class='large-auto cell text-center'>
<a href="https://www.apache.org/events/current-event.html">
<img style="width:234px; height: 60px;" title="Apache Software Foundation current event" src="https://www.apache.org/events/current-event-234x60.png"/>
</a>
</div>
</div>
</div>
<footer>
<div class="grid-container">
<div class="grid-x grid-padding-x">
<div class="large-auto cell">
<h1><a href="../../../../../../front/main/about">About</a></h1>
<ul>
<li><a href="../../../../../../front/main/community/who">Who's Who</a></li>
<li><a href="https://www.apache.org/foundation/thanks.html">Thanks</a></li>
<li><a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
<li><a href="https://www.apache.org/security/">Security</a></li>
</ul>
</div>
<div class="large-auto cell">
<h1><a href="../../../../../../front/main/community">Community</a></h1>
<ul>
<li><a href="../../../../../../front/main/community/mailing-lists">Mailing lists</a></li>
<li><a href="../../../../../../front/main/community/committer">Becoming a committer</a></li>
<li><a href="../../../../../../front/main/community/events">NetBeans Events</a></li>
<li><a href="https://www.apache.org/events/current-event.html">Apache Events</a></li>
</ul>
</div>
<div class="large-auto cell">
<h1><a href="../../../../../../front/main/participate">Participate</a></h1>
<ul>
<li><a href="../../../../../../front/main/participate/submit-pr">Submitting Pull Requests</a></li>
<li><a href="../../../../../../front/main/participate/report-issue">Reporting Issues</a></li>
<li><a href="../../../../../../front/main/participate/#documentation">Improving the documentation</a></li>
</ul>
</div>
<div class="large-auto cell">
<h1><a href="../../../../../../front/main/help">Get Help</a></h1>
<ul>
<li><a href="../../../../../../front/main/help/#documentation">Documentation</a></li>
<li><a href="../../../../../../wiki/main/wiki">Wiki</a></li>
<li><a href="../../../../../../front/main/help/#support">Community Support</a></li>
<li><a href="../../../../../../front/main/help/commercial-support">Commercial Support</a></li>
</ul>
</div>
<div class="large-auto cell">
<h1><a href="../../../../../../front/main/download">Download</a></h1>
<ul>
<li><a href="../../../../../../front/main/download">Releases</a></li>
<li><a href="https://plugins.netbeans.apache.org/">Plugins</a></li>
<li><a href="../../../../../../front/main/download/#_daily_builds_and_building_from_source">Building from source</a></li>
<li><a href="../../../../../../front/main/download/#_older_releases">Previous releases</a></li>
</ul>
</div>
</div>
</div>
</footer>
<div class='footer-disclaimer'>
<div class="footer-disclaimer-content">
<p>Copyright &copy; 2017-2025 <a href="https://www.apache.org">The Apache Software Foundation</a>.</p>
<p>Licensed under the Apache <a href="https://www.apache.org/licenses/">license</a>, version 2.0</p>
<div style='max-width: 40em; margin: 0 auto'>
<p>Apache, Apache NetBeans, NetBeans, the Apache feather logo and the Apache NetBeans logo are trademarks of <a href="https://www.apache.org">The Apache Software Foundation</a>.</p>
<p>Oracle and Java are registered trademarks of Oracle and/or its affiliates.</p>
<p>The Apache NetBeans website conforms to the <a href="https://privacy.apache.org/policies/privacy-policy-public.html">Apache Software Foundation Privacy Policy</a></p>
</div>
</div>
</div>
<script src="../../../../../../_/js/vendor/lunr.js"></script>
<script src="../../../../../../_/js/search-ui.js" id="search-ui-script" data-site-root-path="../../../../../.." data-snippet-length="100" data-stylesheet="../../../../../../_/css/search.css"></script>
<script async src="../../../../../../search-index.js"></script>
<script src="../../../../../../_/js/vendor/jquery.min.js"></script>
<script src="../../../../../../_/js/vendor/what-input.min.js"></script>
<script src="../../../../../../_/js/vendor/foundation.min.js"></script>
<script src="../../../../../../_/js/vendor/jquery.colorbox-min.js"></script>
<script src="../../../../../../_/js/netbeans.js"></script>
<script>
$(function(){ $(document).foundation(); });
</script>
<script src="../../../../../../_/js/vendor/highlight.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
document.querySelectorAll('pre code').forEach((el) => {
hljs.highlightElement(el);
});
});
</script>
</body>
</html>