Skip to content

Commit 7782ba3

Browse files
committed
[GR-69665] Cap to 30GiB to be closer to the previous limit of 29.8GiB
1 parent 3028067 commit 7782ba3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/reference-manual/native-image/BuildOutput.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ GraalVM Native Image: Generating 'helloworld' (executable)...
4848
- Assertions: disabled (class-specific config may apply), system assertions: disabled
4949
--------------------------------------------------------------------------------
5050
Build resources:
51-
- 31.00GiB of memory (49.6% of system memory, capped at 31GiB)
51+
- 30.00GiB of memory (48.0% of system memory, capped at 30GiB)
5252
- 32 thread(s) (88.9% of 36 available processor(s), determined at start)
5353
[2/8] Performing analysis... [*******] (3.7s @ 0.58GiB)
5454
2,140 types, 1,939 fields, and 8,997 methods found reachable
@@ -180,7 +180,7 @@ The memory limit and number of threads used by the build process.
180180
More precisely, the memory limit of the Java heap, so actual memory consumption can be higher.
181181
Please check the [peak RSS](#glossary-peak-rss) reported at the end of the build to understand how much memory was actually used.
182182
The actual memory consumption can also be lower than the limit set, as the GC only commits memory that it needs.
183-
By default, the build process uses the dedicated mode (which uses 85% of system memory) in containers or CI environments (when the `$CI` environment variable is set to `true`), but never more than 31GiB of memory.
183+
By default, the build process uses the dedicated mode (which uses 85% of system memory) in containers or CI environments (when the `$CI` environment variable is set to `true`), but never more than 30GiB of memory.
184184
Otherwise, it uses shared mode, which uses the available memory to avoid memory pressure on developer machines.
185185
If less than 8GiB of memory are available, the build process falls back to the dedicated mode.
186186
Therefore, consider freeing up memory if your machine is slow during a build, for example, by closing applications that you do not need.

substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/MemoryUtil.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ public final class MemoryUtil {
6363
private static final int MIN_AVAILABLE_MEMORY_THRESHOLD_GB = 8;
6464

6565
/*
66-
* Builder uses at most 31GiB to avoid disabling compressed oops (UseCompressedOops).
66+
* Builder uses at most 30GiB to avoid disabling compressed oops (UseCompressedOops).
6767
* UseCompressedOops seems currently disabled on my machine at values > (32 GiB - 32 MiB), so we
68-
* use 31 GiB to have some margin. The actual logic at
68+
* use 30 GiB to have some margin. The actual logic at
6969
* https://github.com/openjdk/jdk/blob/jdk-26+10/src/hotspot/share/runtime/arguments.cpp#L1429
7070
* depends on various factors so it seems unwise to hardcode that exact limit.
7171
*/
72-
public static final long MAX_HEAP_BYTES = 31 * GiB_TO_BYTES;
72+
public static final long MAX_HEAP_BYTES = 30 * GiB_TO_BYTES;
7373

7474
public static List<String> heuristicMemoryFlags(HostFlags hostFlags, List<String> memoryFlags) {
7575
/*
@@ -149,7 +149,7 @@ public static Pair<Long, String> maxMemoryHeuristic(long totalMemorySize, boolea
149149
// Ensure max memory size does not exceed upper limit
150150
if (maxMemory > MAX_HEAP_BYTES) {
151151
maxMemory = MAX_HEAP_BYTES;
152-
reason = percentageOfSystemMemoryText(maxMemory, totalMemorySize) + ", capped at 31GiB";
152+
reason = percentageOfSystemMemoryText(maxMemory, totalMemorySize) + ", capped at 30GiB";
153153
}
154154

155155
// Handle memory flags

0 commit comments

Comments
 (0)