Skip to Content
Java 9: Building Robust Modular Applications
book

Java 9: Building Robust Modular Applications

by Dr. Edward Lavieri, Peter Verhas, Jason Lee
April 2018
Intermediate to advanced content levelIntermediate to advanced
910 pages
33h 21m
English
Packt Publishing
Content preview from Java 9: Building Robust Modular Applications

G1 garbage collection

The G1 garbage collection algorithm was created for use with large memory heaps. This approach involves segmenting the memory heap into regions. Garbage collection, using the G1 algorithm, takes place in parallel with each heap region.

Another part of the G1 algorithm is that when memory is deallocated, the heap space is compacted. Unfortunately, the compacting operation takes place using the Stop the World approach.

The G1 garbage collection algorithm also prioritizes the regions based on those that have the most garbage to be collected.

The G1 name refers to Garbage First.

To manually invoke the G1 garbage collection algorithm for your application, use the following command-line option:

-XX:+UseG1GC
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java 9 High Performance

Java 9 High Performance

Mayur Ramgir, Nick Samoylov
Distributed Computing in Java 9

Distributed Computing in Java 9

Raja Malleswara Rao Malleswara Rao Pattamsetti

Publisher Resources

ISBN: 9781788832823Supplemental ContentOtherPurchase LinkErrata Page