The primary use case for this GC are very short running applications that only allocate a small amount of memory.
To enable G1, specify the option -gc=G1 at image build time.Ĭurrently, G1 can only be used in native images that are built on Linux for AMD64. The G1 GC (only available with GraalVM Enterprise Edition) is a multi-threaded GC that is optimized to reduce stop-the-world pauses and therefore improve latency, while achieving high throughput.It is optimized for low memory footprint and small Java heap sizes. The Serial GC is the default GC in both GraalVM Community and Enterprise Edition.When the heap becomes full, a garbage collection is triggered to reclaim memory of objects that are no longer used.įor managing the Java heap, Native Image provides different garbage collector (GC) implementations: The Java heap is created when the native image starts up, and may increase or decrease in size while the native image runs. Java objects that a native image allocates at run time reside in the area called “the Java heap”. That runtime includes all necessary components, and one of them is the memory management. A native image, when being executed, does not run on the Java HotSpot VM but on the runtime system provided with GraalVM.