Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to measure performance in Java developement

Is there any tool can measure execution time for each function call and find out bottle neck for a given developing java j2se project? Thanks!

like image 244
Stan Avatar asked Jan 28 '10 09:01

Stan


People also ask

How do you detect performance issues in Java?

Solution: Monitor pool metrics like allocated, free, and managed. Also monitor java performance metrics related to other connections to the database, like the total connection time, active connections, and the health of the database server. This can help you identify the cause of connection leaks.


3 Answers

Use profiling tools, such as YourKit, JProfiler and HPROF (this one is a command line tool).

like image 195
b.roth Avatar answered Sep 22 '22 10:09

b.roth


You are looking for a profiler. I know that NetBeans includes a decent one.

You can also look at this question: Open Source Java Profilers.

It seems that the JDK 1.6 comes with a basic profiler. So maybe you want to give it a try first.It should be included with the VisualVM that comes with your jdk6: visualvm profiler

like image 43
Janusz Avatar answered Sep 22 '22 10:09

Janusz


Yes, there are lot of tools - profiles like Netbeans Profiler or eclipse equivalent. Look at this course of JavaPassion to find out more about profiling tools and performance of Java applications.

Look at also this SO question to find out open source java profiles.

like image 45
cetnar Avatar answered Sep 21 '22 10:09

cetnar