Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Free Java Profiling with Oracle Java Mission Control

DZone's Guide to

Free Java Profiling with Oracle Java Mission Control

· Performance Zone
Free Resource

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. TheDefaultRecordMapperProvider.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/

Topics:

Published at DZone with permission of Lukas Eder, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}