How to test java application for performance bottlenecks?
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?
I'm often happy enough using
Java -Xprof. This gives you a sorted list of the functions your code spends most of its time in.
Read more... Read less...
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
It'll give you a bunch of threads, like the GarbageCollector. Don't worry about those, just look at where your threads are.