Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions mx.graalpython/mx_graalpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,19 @@ def libpythonvm_build_args():
# MAP_JIT memory is mapped next to the (ASLR-slid) dylibs.
build_args += ['-H:-RandomizeRuntimeCodeCache']

if not graalos and not _is_overridden_native_image_arg("-R:MaxNewSize"):
# The serial collector starts with a 128 MB heap and a young generation of about 48 MB, and is
# allowed to grow the young generation to 10% of physical memory. Every page of the young
# generation is touched before the first collection and stays resident, so a small program
# keeps tens of MB of garbage. A 16 MB young generation bounds that; --vm.Xmn overrides it.
build_args += ['-R:MaxNewSize=16777216']

if not graalos and not _is_overridden_native_image_arg("-R:+CompileInIsolates") and not _is_overridden_native_image_arg("-R:-CompileInIsolates"):
# Runtime compilation runs in a separate isolate by default, with its own heap (which starts
# with a young generation of about 48 MB) and a second mapping of the image heap that it
# touches. Compile in the main isolate instead; --vm.XX:+CompileInIsolates restores it.
build_args += ['-R:-CompileInIsolates']

profile = None
require_profile = get_boolean_env("GRAALPY_REQUIRE_PGO_PROFILE")
if (
Expand Down
Loading