SIGN IN SIGN UP

GC: permanently mark pkg/sysimage objects to speed up GC (#61474)

Image objects are already never freed and are ~somewhat rarely mutated,
making them candidates for "pretenuring".

Load image objects as permanently marked (`GC_OLD_MARKED`) so
`gc_try_setmark_tag` returns 0 immediately and the mark phase never
enters the image subgraph. Maintain any mutations as a dedicated
`image_remset` which effectively roots any "new" referents that are
referred to by the image subgraph.

This significantly speeds up (full) GC pause times when dominated by
immutable objects in the sysimage / pkgimage heaps.

This can likely also be generalized slightly to a "permalloc / pretenure"
operation that applies to objects not necessarily in images. I'm not sure
whether it'd be possible to "unfreeze" those objects once they are
promoted to permalloc'd / pretenured though.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
C
Cody Tapscott committed
c0763cba676dae3a5c44567438136f0d2991465c
Parent: 70059dd
Committed by GitHub <noreply@github.com> on 5/21/2026, 7:16:02 PM