Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Outline

Sample to show allocations in a Java Flight Recording

This program checks whether a number is prime.

Run the program and also make a profiling recording.

How to run

java -Xms64m -Xmx64m -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints -XX:+FlightRecorder -XX:StartFlightRecording=settings=profile,duration=30s,name=Allocations,filename=allocations.jfr -Xlog:jfr=info -jar target/allocations.jar

Analyzing Java Flight Recording

In Memory -> Allocation tab, you should see a high allocation rate.

Also, see Memory -> Garbage Collections tab and check the frequency of GC events.

Improving Performance

Try the program again after changing Long types to primitive long.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.