Advertisement
Advertisement


How to test java application for performance bottlenecks?


Question

I am reviewing a big java application to see if there are any performance bottlenecks. The real problem is that I cannot pinpoint the performance issues to any single module. The whole application is slow as such.

Is there some tool/technique I can use to help me out in this?

2008/09/01
1
11
9/1/2008 1:22:19 PM

Accepted Answer

Try using a profiler on your running code. It should help you identify the bottlenecks. Try jprofiler or Netbeans profiler

2008/09/01
8
9/1/2008 1:25:22 PM


If you are running on Java 6 you can use the supplied monitoring tools

2008/09/01

For testing/development purposes, you can download Oracle JRockit Mission Control for free from this site. (Requires Login, but accounts can be set up with any email adress)

Docs Here. It will allow you to find hotspots, memory leaks and much more.

2008/09/02

YourKit is a excelent java profiler (not free).

2013/10/21

As we see from How can I profile C++ code running in Linux?, the most statistically significant approach is to use a stack profiler.

Well, Java runs in the JVM, so getting a stack useful for C code won't be useful for us (it'll get the JVM stuff, not your code). Fortunately, Java has jstack! http://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jstack.html

It'll give you a bunch of threads, like the GarbageCollector. Don't worry about those, just look at where your threads are.

2017/05/23