Skip to content

Determine GC mark vs sweep pause ratios #125

Open

Description

@edwintorok

https://github.com/damiendoligez/ocaml/blob/33bd051033f202efead00e342d78cdeb1c482aae/runtime/major_gc.c#L945 has a comment

/* TODO find the right value for sigma. */
static double pp_sigma = 4.0;

The meaning of pp_sigma is defined in https://github.com/damiendoligez/gc-pacing/blob/main/gc-pacing.pdf

This is the ratio of sweeping to marking “speed”. It will be chosen to make
the GC pauses of the Sweep and Mark phases approximately equal in real-time.
This is normally larger than 1 because it turns out that the GC code needs to do
more work to mark x words of memory than to sweep the same amount. Note
that this ratio is a function of the GC code rather than the memory behaviour of
the program. We will choose a reasonable constant after studying the run-time
behaviour of the code

It'd be nice to see whether olly has enough information to measure and determine that ratio, so that we can have some realistic data on what the elapsed CPU time for marking vs sweeping is from our benchmark set, which can be used to tune that constant in the future.
(in theory the optimal constant should only depend on the GC code, and be similar across all benchmarks that use a reasonable amount of memory, but I'd expect some variation due to cache behaviour)

Activity

  1. changed the title [-]determine GC mark vs sweep pause ratios[/-] [+][enhancement] determine GC mark vs sweep pause ratios[/+] on Aug 18, 2026
  2. changed the title [-][enhancement] determine GC mark vs sweep pause ratios[/-] [+]Determine GC mark vs sweep pause ratios[/+] on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions