Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance profiler for a java application

I need to optimise a Java application. It makes some 3rd party calls. I need some good tool to accurately measure the time taken by individual API calls. To give an idea of complexity- the application takes a data source file containing 1 million rows, and it takes around one hour to complete the processing. As a part of processing , it makes some 3rd party calls (including some network calls). I need to identify which calls are taking more time then others, and based on that, find out a way to optimise the application.

Any suggestions would be appreciated.

like image 200
Nitin Garg Avatar asked Jun 14 '10 07:06

Nitin Garg


People also ask

How do you check the performance of a Java program?

Using VisualVM (jvisualvm) jvisualvm is a tool to analyse the runtime behavior of your Java application. It allows you to trace a running Java program and see its the memory and CPU consumption. You can also use it to create a memory heap dump to analyze the objects in the heap.

What is application performance profiling?

Performance profilers are software development tools designed to help you analyze the performance of your applications and improve poorly performing sections of code.


1 Answers

I can recommend JVisualVM. It's a great monitoring / profiling tool that is bundled with the Oracle/Sun JDK. Just fire it up, connect to your application and start the CPU-profiling. You should get great histograms over where the time is spent.

Getting Started with VisualVM has a great screen-cast showing you how to work with it.

Screen shot:

VisualVM screenshot


Another more rudimentary alternative is to go with the -Xprof command line option:

-Xprof

Profiles the running program, and sends profiling data to standard output. This option is provided as a utility that is useful in program development and is not intended to be be used in production systems.

like image 189
aioobe Avatar answered Sep 22 '22 17:09

aioobe