Free Java Profiling with Oracle Java Mission Control


Do you profile your code using JProfiler or YourKit? You should, because their licenses are worth every penny when you can find a very hidden and subtle bottleneck deep down in your application.

For instance, the following chart shows nicely that there was a significant performance issue in jOOQ related to reflection:

Before...

Before…

I’ll spare you the details about the fix, but the RecordMapper.map() method is where the magic happens. The DefaultRecordMapperProvider.provide() method is really just boring initialisation. No way should it gobble up 96% of the benchmark. So the fix was applied and we profile again:

After... Yay!

After… Yay!

As you can see, the RecordMapper.map() is now using up most of the CPU time (the whole thing accelerated from 134 seconds down to 1.4 seconds in a benchmark)

Now, profilers cost some money and if money for the license is an issue for you, then there is good news! Since JDK 7u40, Oracle now ships their Oracle Java Mission Control (JMC) for its Hotspot VM and you can use it for free in development environments (not in production). But that’s more than enough!

JMC isn’t quite as powerful yet as JProfiler or YourKit. But again, you’re doing this because you want to save money, and that’s better than just staring at the JMX console or throwing random thread dumps around your console.

For more information, visit the following website:
http://download.oracle.com/technology/products/missioncontrol/updatesites/base/5.2.0/eclipse/

Tags: , , , , , ,

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

Follow

Get every new post delivered to your Inbox.

Join 1,969 other followers

%d bloggers like this: