Netbeans profiling

Netbeans 6.5 has a very useful Profiler which helps a lot in pinpointing exactly which method is the culprit when your app comes to a crawl: 

 

– In Netbeans pick  Menu Profile -> Profile Main Project to active the profiler (which I believe is built on top of VisualVM).

 

– Rerun the app and replay the actions which caused it to freeze

 

– at that point move on to the Netbeans “Profiler” panel and take a snapshot of the threads call tree. 

 

– Sorting the call tree by time descending should make any bottleneck immediatly obvious.

 

Example:  below is the call tree associated with a Java app I’m currently working on. 

nb profile all threads

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The refreshTicksHorizontal method (part of the JFreeChart API) seems to take a suspisciously long time to execute… 

Poking around the JFreeChart forums it became soon clear why

Advertisements

One thought on “Netbeans profiling

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s