Skip to content

Commit

Permalink
[GR-34675] Minor clarification in the documentation.
Browse files Browse the repository at this point in the history
PullRequest: graal/15963
  • Loading branch information
wirthi committed Nov 6, 2023
2 parents 04f57e0 + fc1c8c0 commit 902dba9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/reference-manual/native-image/MemoryManagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The Java heap is created when the native image starts up, and may increase or de
When the heap becomes full, a garbage collection is triggered to reclaim memory of objects that are no longer used.

For managing the Java heap, Native Image provides different garbage collector (GC) implementations:
* The **Serial GC** is the default GC in GraalVM.
* The **Serial GC** is the default GC in GraalVM Native Image.
It is optimized for low memory footprint and small Java heap sizes.
* The **G1 GC** is a multi-threaded GC that is optimized to reduce stop-the-world pauses and therefore improve latency, while achieving high throughput.
To enable it, pass the option `--gc=G1` to the `native-image` builder.
Expand All @@ -42,7 +42,7 @@ The exact values may depend on the system configuration and the used GC.

* The *maximum Java heap size* defines the upper limit for the size of the whole Java heap.
If the Java heap is full and the GC is unable reclaim sufficient memory for a Java object allocation, the allocation will fail with the `OutOfMemoryError`.
Note: The maximum heap size is only the upper limit for the Java heap and not necessarily the upper limit for the total amount of consumed memory, as Native Image places some data such as thread stacks, just-in-time compiled code, and internal data structures in memory that is separate from the Java heap.
Note: The maximum heap size is only the upper limit for the Java heap and not necessarily the upper limit for the total amount of consumed memory, as Native Image places some data such as thread stacks, just-in-time compiled code (for Truffle runtime compilation), and internal data structures in memory that is separate from the Java heap.
* The *minimum Java heap size* defines how much memory the GC may always assume as reserved for the Java heap, no matter how little of that memory is actually used.
* The *young generation size* determines the amount of Java memory that can be allocated without triggering a garbage collection.

Expand Down Expand Up @@ -234,4 +234,4 @@ Which data is printed in detail depends on the used GC.

### Further Reading

* [Memory Configuration for Native Image Build](BuildConfiguration.md#memory-configuration-for-native-image-build)
* [Memory Configuration for Native Image Build](BuildConfiguration.md#memory-configuration-for-native-image-build)

0 comments on commit 902dba9

Please sign in to comment.