Repository navigation
Native: start the isolate with -XX:MaximumHeapSizePercent=50 by default - #74
Merged
Merged
Conversation
GraalVM's default heap limit is 80% of the memory the isolate sees (the container limit when there is one). With the engine's off-heap memory on top, the kernel killed the process in memory-limited containers. The glue now passes -XX:MaximumHeapSizePercent=50 as an isolate argument unless ARCADEDB_NATIVE_ISOLATE_ARGS already has -Xmx, -XX:MaximumHeapSizePercent or -XX:MaxRAM (theirs wins). The isolate arguments are now always non-empty (the log directory is always set), so the dead "if iso_args:" branch is gone. Tests: the default and the override rules, and on the real image the default max_heap is about half of the memory and a user percent, -Xmx or -XX:MaxRAM replaces it. Docs: a heap-size section in the installation page. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The native build now starts its GraalVM isolate with
-XX:MaximumHeapSizePercent=50by default, instead of GraalVM's 80%. If the user sets the heap inARCADEDB_NATIVE_ISOLATE_ARGS(-Xmx...,-XX:MaximumHeapSizePercent=...or-XX:MaxRAM=...), nothing is added and theirs wins. Python only: no Java change and no image rebuild.Why
With the 80% default the engine's off-heap memory comes on top of an almost full heap, and in a memory-limited container the kernel kills the process. In the container probes the process was OOM-killed 6 of 6 times in the two memory-limited cases with 80%, and ran clean 6 of 6 times with 50%. Both percentages follow the cgroup memory limit, not the host RAM, so a 4 GB container gets a 2 GB heap.
Evidence
The choice was made under a rule fixed before the runs. A timed laptop A/B (
ab.py --noise, ABBA order, 41 figures, at least 11 clean pairs per figure, two replicates) showed no time figure worse than 5% against the old default. The large-data figures were at 0.995 to 1.010 of the old time, and peak RSS was not higher. So the lower limit costs no speed and removes the kills.The image accepts
-XX:MaximumHeapSizePercent=<n>,-Xmx<n>and-XX:MaxRAM=<n>. It does not accept-XX:MaxRAMPercentage: isolate creation fails with rc=22. The docs say so.Changes
src/arcadedb/_native/lib.py: new_heap_isolate_args(user_args);_loadalways builds the isolate parameters now (the log-directory arguments are always there), so the deadif iso_args:is gone.tests/test_native_heap.py(native only, registered inconftest.py): the default argument; each of-Xmx,-XX:MaximumHeapSizePercentand-XX:MaxRAMsuppresses it; other arguments keep it; and on the real imagelib.diag()["max_heap"]is 0.5000 of the host memory by default (16294346752 of 32589176832 bytes here) and a user percent,-Xmxor-XX:MaxRAMreplaces the default.docs/modules/ROOT/pages/installation.adoc: a short "Heap size" section under the native build notes (the default, how to override it, that it follows the container limit, that-XX:MaxRAMPercentageis not accepted), with a link to the main ArcadeDB docs for the native image.Tests run
On a locally built image (
ARCADEDB_BACKEND=native):test_native_heap.py,test_native_log_dir.py,test_native_startup.py,test_native_startup_runtime.py,test_log_dir.pyandtest_core.py: 66 passed, 3 skipped (the three skips are the existing JVM-only cases intest_log_dir.py). Bandit 1.9.4 (--severity-level low --confidence-level low): no issues.isort --profile blackand black: clean on the touched files.scripts/check_no_embedded_name.py: ok.This PR targets
native-two-dist, the base of #66.🤖 Generated with Claude Code