Mike W
Mike W

Reputation: 1148

high-performance java profiler

I see that there are a bunch of "java profiler recommendation" questions that are already answered here. My case is slightly specific, though.

I need to profile a production system that has thousands of live users on it. So I need a lightweight profiler that isn't going to slow the system down to a grinding halt.

I'm running on Tomcat 6.0.29 on JDK 1.6.0_20 on Linux.

My preference would be a free open source profiler. But if there's a commercial one that is clearly the best choice, then that would be fine as well.

Upvotes: 1

Views: 1807

Answers (3)

jun
jun

Reputation: 51

I prefer Java Flight Recorder. It causes almost no performance overhead and has a nice GUI. Add JVM parameters

-XX:+UnlockCommercialFeatures -XX:+FlightRecorder
-XX:StartFlightRecording=name=test,filename=test.jfr,dumponexit=true 

and open the record with JMC.

Upvotes: 1

The Alchemist
The Alchemist

Reputation: 3425

Without breaking into a profiler fightout (you can google for that), CPU sampling is generally recognized to one of the least computationally-intensive profiling methods. This is critical if you're profiling an app in production.

Read the following SO post: - Which Java Profiling tool do you use and which tool you think is the best?

You can even just use the JDK and the hprof tools, although even the basic profiler will probably be better.

The trick will be to limit the amount of classes to be profiled, as skafman says.

Upvotes: 0

Have a look at jvisualvm in the JDK.

It can attach to a running process both locally and also across the network (but with reduced functionality) and allow you to do profiling for both CPU and memory. Have a look at http://blip.tv/file/1582849

Upvotes: 3

Related Questions