From charlesreid1

Revision as of 05:21, 19 March 2017 by Admin (talk | contribs) (Created page with "=Methods= There are various methods for profiling Java code. Some are covered below. =Java Mission Control= Not nearly as useful, since you don't get a method-level breakd...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Methods

There are various methods for profiling Java code. Some are covered below.


Java Mission Control

Not nearly as useful, since you don't get a method-level breakdown of how much time was spent in various places in the code. Lots and lots of superfluous information, though.

Compiling

Nothing special is required when you compile your code if you are going to profile it with Java Mission Control.

$ javac NQueens.java

Running

You can specify that Java should create an output file for Java Mission Control by using flags:

$ java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -Dscijava.log.level=error -XX:StartFlightRecording=name=MyRecording,duration=999s,filename=//tmp/my_flight_recording.jfr,settings=profile NQueens

For the recursive backtracking method, this did not reveal anything about where the real time was being spent.


References

List of Java profiling tools: http://imagej.net/Profiling_Java_Code