Explore related resources

Find more information about the topics in this Learning Path:

Give feedback

How would you rate this Learning Path?

Review frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
How do I set up Java?
Install Java using the Arm Java install guide . After installation, run java --version to confirm it’s available.
How do I check my JDK version and decide whether to upgrade?
Run java --version and review the reported release. Use one of the latest LTS JDKs because newer releases include GC improvements, such as G1GC pause time improvements from JDK 8 to JDK 11.
How can I monitor garbage collection while the Java program runs?
Run jstat -gcutil $(pgrep java) 1000 in a second terminal while the example application runs. Review the YGC, YGCT, FGC, FGCT, and GCT columns to assess young, full, and total GC activity.
What should I expect when running the example application?
The program prints a startup message and then rapidly allocates many String objects to fill the heap. This makes GC behavior easier to observe so you can compare runs under different configurations.
How do I enable GC logging for the example application?
For JDK 11 and later, run java -Xms512m -Xmx1024m -XX:+UseSerialGC -Xlog:gc:file=gc.log:tags,uptime,time,level:filecount=10,filesize=16m HeapUsageExample.java. For JDK 8, use the -Xloggc:gc.log, -XX:+PrintGCTimeStamps, and -XX:+UseGCLogFileRotation options instead. Both commands create a gc.log file.

Share

Tell others about this Learning Path.

Back
Return to Servers and Cloud Computing