Set DART_VM_OPTIONS for image proxy to adjust GC - #9557
Closed
sigurdm wants to merge 2 commits into
Closed
Conversation
Configure `--old_gen_heap_size=768` to cap old generation heap size and trigger GC compaction before container memory limits, and `--dontneed_on_sweep` to release freed heap pages back to the host kernel via madvise(MADV_DONTNEED).
Contributor
Author
|
Hmm, I would think so - nice to prevent OOM by triggering GC before it grows out of your available memory. but of course I don't really knows how well it works. @mkustermann might be able to give guidance... |
This was referenced Sep 1, 2026
Contributor
Author
|
Closing for now. As detailed in dart-lang/sdk#29786 (comment), setting The Cloud Run container memory for image proxy has already been doubled to 1 GiB in cl/973847545, which provides ample headroom for concurrent requests without needing a manual VM heap cap. |
Member
|
/cc our GC expert: @rmacnak-google |
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.
Configure
DART_VM_OPTIONS="--old_gen_heap_size=768"for the image proxy server in both the Dockerfile and Cloud Build deployment step.--old_gen_heap_size=768: caps old generation heap (75% of the 1 GiB container memory limit) to trigger garbage collection before reaching container memory boundaries, leaving ~256 MB for new-gen heap, thread stacks, TLS/socket buffers, and runtime overhead.Improves the situation on #9554 (but we should also increase memory).