Finding recommendations for end-to-end Java CPU profiles

What are the good processor end profiles that exist for Java?

A quick list of things I'm looking for:

  • Offline profiling - no user interaction or graphical interface is required during program execution. Dumping profile data to a file, and then requiring viewing later using the graphical interface, I just don't want him to nurse him when the job is done
  • End recording - The profiler should be able to start recording immediately after entering the main call for the J2SE application. It should stop recording just before the JVM exits.
  • Call generation generation. After profiling, it would be nice to turn the data into a visual call schedule.

Google has a good profiler for C / C ++ - http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html

If the Java equivalent of this exists, this will be exactly what I'm looking for.

I don’t include HProf in the list of potential profilers because it doesn’t work well compared to other commercial profilers that I looked at when you use accurate CPU profiling (usually done byte injection of code, which is slow, but HProf is at least an order of magnitude slower than other profilers, and when one sampling profile works for 1-2 hours, it is unacceptable to wait more than one day for the same run)

+6
java profiling
source share
4 answers

My favorite is definitely JProfiler . I did not understand this just now (because I always use the interactive graphical profiling interface), but it actually supports offline profiling, just like you described.

Some other interesting features:

  • Profiles all your SQL queries, so you can see which database queries are slowing you down.

  • It keeps track of which methods (in which classes and packages) allocate most of the memory, for what types of objects and arrays, as well as the durability of these objects. So, if you have a memory leak, it's easy to determine which types of class instances come out of their utility and find the methods from which these objects were originally extracted (and who keeps the links that keep the objects alive).

  • You can track the growth of a virtual machine, control the frequency of complete GC collections, and determine how many objects (of what type) were freed during each collection cycle.

  • And, of course, you get a hierarchical breakdown of all method calls, the number of calls and the average execution time (exclusive or inclusive) of the entire call stack. You can also view this hierarchy in terms of the “worst bottlenecks” of functions ordered either by runtime or by memory allocation.

For me, JProfiler is one of the most important tools in my development process (second only for Eclipse).


Also: There is a free 10-day trial . Download it and check. And by the way, I'm not affiliated with the company or anything else. I have been a happy customer for the past five or six years.

+5
source share

I am not familiar with offline profiling. Isn't that what hprof is for ?. Otherwise, I had very good experience with YourKit profiler .

+3
source share

I was very pleased with the NetBeans Profiler ; I believe that it also satisfies all your requirements.

+1
source share

You can try the runtime analyzer that comes with JRockit Mission Control . It creates recording files that you can open in the GUI later. The overhead is very low, usually less than 1-2%, and it is very easy to use.

You can start recording from the command line as follows:

JROCKIT_HOME \ bin> java -XXjra: recordtime = 2000s, filename = myrecording.jra, sampletime = 1

and if the JVM shuts down before recording ends, the profiling data will be flushed to disk.

0
source share

All Articles