Best Java tools for profiling

Best Java tools :

Recently, I was building real-time, high performance back-end Java application which computes 16K ratios per company for around 70K companies (~1.1bn total) by pulling data from different data sources like, Mongodb, Cassandra, Mysql and Redis. It was multi-threaded application which was using Dynamic programming approach for storing intermediate results to pass as an input to calculate derived ratios on next layer. Having small setup of average servers which were serving both front-end application and back-end batch processing, It was very important to build solution which has less CPU/IO and memory utilization.
When I tested application the first time, response time for computing one company was 2mnts with 20mb memory usage and it was really not acceptable.
So, I decided to profile code to find duplicate computations to reduce CPU/IO which will improve response time and remove any memory leaks due to strong references. I searched for best tool for profiling java application and came across some amazing tools which help me reduce response time to 4sec and <2Mb memory usage for one company (before GC).


All these tools are as following,

1) VisualVM :

It is free and very handy all-in-One Java troubleshooting visual tool integrating command-line JDK tools and lightweight profiling capabilities. Designed for both development and production time to monitor application locally and remotely. VisualVM comes with default Oracle Hotspot JVM installation which gives you insights of CPU Utilization, Memory Usage, Threads, CPU/Memory sampling/profilling.
You can extend basic functionality adding more plugin for Mbean, Jconsole and Garbage collection. It is possible to take Thead/Heap dump and perform manual GC on running application. It is super set of Jconsole and requires Jstatd for monitoring application remotely.
More details can be found here, VisualVM.


2) Java Mission Control :

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed run-time information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collection framework built into the Oracle JDK. It allows Java administrators and developers to gather detailed low level information about how the Java Virtual Machine (JVM) and the Java application are behaving. Java Mission Control is an advanced set of tools that enables efficient and detailed analysis of the extensive of data collected by Java Flight Recorder.
The tool chain enables developers and administrators to collect and analyze data from Java applications running locally or deployed in production environments.
More details can be found here, Java Mission Control.


Following tools are paid but they gives you very deep insights to pin point issues and save lots of time.

3) JProfiler:

JProfiler is paid all-in-One paid with intuitive UI which helps you resolve performance bottlenecks, pin down memory leaks and understand threading issues.
More details can be found here, JProfiler.


3) Yourkit:

YourKit is paid all-in-one profiler utilizes all of the advanced Java profiling features and capabilities. It profile any SE or EE application, server, technology and framework; on multiple platforms; locally and remotely; in development, testing and production. For teams and companies of any size.
More details can be found here, Yourkit.


I hope, this post will save your precious time on finding best java profiling tools.
Thank you.

This entry was posted in Java and tagged . Bookmark the permalink.

Leave a Reply