From dd630f48b22c89ac7b0f8ba3d42b68d4ca02022e Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Mon, 20 Oct 2025 20:15:06 +0200 Subject: [PATCH 1/3] Switch to SGC with compacting old gen and enable relative code pointers to reduce rss --- mx.graalpython/mx_graalpython.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mx.graalpython/mx_graalpython.py b/mx.graalpython/mx_graalpython.py index c94f524966..532e275a6e 100644 --- a/mx.graalpython/mx_graalpython.py +++ b/mx.graalpython/mx_graalpython.py @@ -297,16 +297,21 @@ def libpythonvm_build_args(): if graalos := ("musl" in mx_subst.path_substitutions.substitute("")): build_args += ['-H:+GraalOS'] else: - build_args += ["-Dpolyglot.image-build-time.PreinitializeContexts=python"] + build_args += [ + "-Dpolyglot.image-build-time.PreinitializeContexts=python", + "-H:+UnlockExperimentalVMOptions", + '-H:+RelativeCodePointers', + '-H:+CompactingOldGen', + "-H:-UnlockExperimentalVMOptions", + ] if ( - mx.is_linux() - and not graalos + not graalos and mx_sdk_vm_ng.is_nativeimage_ee() and not os.environ.get('NATIVE_IMAGE_AUXILIARY_ENGINE_CACHE') and not _is_overridden_native_image_arg("--gc") ): - build_args += ['--gc=G1', '-H:-ProtectionKeys'] + build_args += ['-H:-ProtectionKeys'] profile = None if ( From 731c788883352b2562c7831dad5e3c2227672c0e Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Fri, 10 Apr 2026 11:36:12 +0200 Subject: [PATCH 2/3] [GR-70922] Add changelog entry for native footprint change --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 276a85af44..d5aecef1c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ language runtime. The main focus is on user-observable behavior of the engine. * Enable FTS3, FTS4, FTS5, RTREE, and math function features in the bundled sqlite3 library. * Add support patches for Torch 2.7.0, PyGObject 3.52.3, xmlschema 4.0.0, lxml < 5.4.0, SciPy 1.15, jq 1.8.0, NumPy < 2.3, ormsgpack < 1.9.1, pandas 2.2.3, PyArrow 19.0, PyMuPDF 1.25.4. * The GraalPy Native standalone on Linux now uses the G1 garbage collector which is much faster. +* The GraalPy Native standalone on Linux now uses a lower-footprint Native Image garbage collection configuration. This reduces resident set size (RSS) for many workloads, but may increase startup time and warmup time, and can slow down some workloads. * The full-featured Python REPL is now available on GraalPy standalone builds for Windows. ## Version 24.2.0 From 6ed89ce3b19ffb437f2f75c2071eee17cae4e969 Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Fri, 10 Apr 2026 11:53:19 +0200 Subject: [PATCH 3/3] [GR-70922] Drop explicit CompactingOldGen flag --- mx.graalpython/mx_graalpython.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mx.graalpython/mx_graalpython.py b/mx.graalpython/mx_graalpython.py index 532e275a6e..ae1ba77e18 100644 --- a/mx.graalpython/mx_graalpython.py +++ b/mx.graalpython/mx_graalpython.py @@ -301,7 +301,6 @@ def libpythonvm_build_args(): "-Dpolyglot.image-build-time.PreinitializeContexts=python", "-H:+UnlockExperimentalVMOptions", '-H:+RelativeCodePointers', - '-H:+CompactingOldGen', "-H:-UnlockExperimentalVMOptions", ]