Sunday, September 16, 2007

The NetBeans Profiler [part 2]

Last time we saw how to use the netbeans profiler control panel, we also explored the different ways of attaching a profiler to an application and options to monitor its performance..

if you are clueless about this then perhaps you should read the earlier post. These links takes you there



Now let's make a meaning out of the information captured by the profiler.

When profiling is in progress, there two types of results that you would get

1. The live Result : These results are updated regularly while profiling session is in progress.

The snapshot below makes everthing clear as it shows clearly the live results I'm getting while profiling my application.

Depending on your settings, the sector you are monitoring and the way you attached the profiler the live result button will not be active. I chose to monitor most options so on starting the session the thread windows opens in the source editor and the live result window opened automatically.

The telemetry view pops up below but if you want to have a full view double click on it and a similar one to the last snapshot above will open in the source editor.

Take some ample time to watch what is happening to the areas you are monitoring. Let's take the telemetry view for example, when opened in the editor depending on your settings you might have at least three tabs just below the window all displaying high level data on what ever its you are monitoring some of which are the garbage collection, memory heap and the likes. Watch carefully how your applications use the systems resources.

2.The Snapshot : On earlier post we saw the use of the snapshot, when profiling you could if you want to capture results on the fly, you can save them and later use them in accessing how you application fared during a particular operation.

here is a snapshot on a snapshot I saved while profiling my application

To capture, click on the take snapshot button to capture profiling info immediately, click save if you want a copy of it.

By now a newbie like you and I should have been convinced to stick to NetBeans ; It makes java programming more FUN and offers a convenient learning environment........

The last part of the profiler will be posted next week ... Don't Miss out.

Keep Exploring..........

Monday, September 10, 2007

NetBeans Profiler [part2] ...ON HOLD

I promised a part two of the NetBeans profiler on my last post but I couldn't due reason beyond my control.

The article will be out by the end of this week......

Sunday, September 2, 2007

The NetBeans Profiler [ part 1 ]

I assume you have read my first post on the profiler so i believe you know where the profiler windows is. If you don't then read the earlier post on NetBeans Profiler

Now lets get more familiar with the profiler window...


Depending on the version you are using some buttons might not be there.

  • The first control when clicked runs the last profiling command again.

  • The stop button next to it stops the profiling sessions.

  • Next button resets the results buffer.

  • The trash can button runs the garbage collector (GC).

  • The control next to it is useful when you want modify a profiling session.

  • The last button opens the VM (virtual machine) Telemetry overview window.

Results Section

  • The first button “take snapshot” captures the profiling information on the fly.

  • The “live Result” button retrieves current profiling information and opens it in the source editor window.

  • If you don't need the results already accumulated the button below those two does the job.


View and Basic Telemetry

The VM Telemetry button opens the a window displaying data on the inner process of the java virtual machine.

The thread button opens a window in the editor displaying thread activities of the on going profiling session. [ only works if thread monitoring is enabled ]

The basic telemetry view provides a quality data on the profiling tasks..

You are now familiar with the profiling window... now lets get straight to business

Profiling a class or a project

Generally, to profile any project be it main or not, right-click on the project folder in the project window and select the “profile project” option

on clicking the above option this dialog pops up

The options are yours to select, you can either profile the whole application or part of it.

if you want profile just part of the application, as soon as you select it you'd be given additional options to edit or select the classes you want to profile. Click the “Run” button when you are done... NetBeans profiler does the rest.

You should notice that most of the buttons in the profiler window is enabled ..

To attach a profiler to a running application all you have to do is select "profile" from the main menu and then select "attach Profiler" options.

The attach profiler dialog should appear... its the same as the one above but with an attach button instead of a run button.

select your options and click the attach button to run the attach wizard.. here is

select “application” in the target field, leaving the other fields in their default unless you are running it remotely. click next to continue. click next again and finally click finish to start profiling. The progress bar should appear..

wait till it finishes and you are ready to monitor you selected options.


when you want profile a project for the first time, you would probably see this dialog

just click Ok and continue.

Now lets explore the run/attach profiler dialog...

click on the CPU button on the left pane to select options to analyze the cpu performance

click on the monitor button if you intend to monitor thread activities....

click on the memory if you intend to keep an eye on memory usage and garbage collection.

Each of these controls when clicked gives an option to create custom settings.

Now that we know the basics of the profiler, I will end here...

We will delve deeper on my next post.....

keep exploring......


© New Blogger Templates | Webtalks