Skip to content

Add multi-Ractor memory benchmarks - #538

Draft
eightbitraptor wants to merge 2 commits into
mainfrom
mvh-gc-ractor-benchmarks
Draft

eightbitraptor wants to merge 2 commits into
mainfrom
mvh-gc-ractor-benchmarks

Conversation

@eightbitraptor

Copy link
Copy Markdown
Member

Add three benchmarks that expose pathological memory behaviour with
multiple ractors.

  • ractor-dead-set: every ractor builds a large live set and terminates;
    their final live sets cannot be reclaimed by a full GC.

  • ractor-idle-garbage: every ractor builds and drops a large set, then
    idles without allocating; the garbage cannot be swept while they idle.

  • ractor-msg-backlog: unshareable payloads flood the queues of gated
    consumer ractors, duplicating data per consumer.

benchmarks.yml marks them ractor_only with default_harness
harness-ractor-mem, which overrides the --category ractor default.

A harness for ractor memory pathology benchmarks. The scenario block
runs on the main Ractor and receives the ractor count; it may return a
cleanup proc, which the harness calls after measuring retained RSS so a
scenario can park idling ractors that outlive the measurement window.

Retained RSS is measured against a single pristine process-start
baseline after GC settle. A per-trial baseline would collapse toward
zero, because memory retained by dead or idle ractors is reused by
later allocation rather than returned to the OS. Peak RSS is sampled by
a background thread and verified against VmHWM. Scenario wall times are
reported so result tables keep working.
Add three benchmarks that expose pathological memory behaviour with
multiple ractors, for GC work that reclaims ractor-local memory:

- ractor-dead-set: every ractor builds a large live set and terminates;
  their final live sets cannot be reclaimed by a full GC.
- ractor-idle-garbage: every ractor builds and drops a large set, then
  idles without allocating; the garbage cannot be swept while they idle.
- ractor-msg-backlog: unshareable payloads flood the queues of gated
  consumer ractors, duplicating data per consumer.

benchmarks.yml marks them ractor_only with default_harness
harness-ractor-mem, which overrides the --category ractor default.
Pin that selection with a regression test, and document the benchmarks
in the README.
@luke-gruber

Copy link
Copy Markdown
Collaborator

I think we should look into using the --ractor-gc flag along with the ractor harness for the new GC benchmarks. Getting that PR merged first is probably a good idea.

@luke-gruber luke-gruber left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge --ractor-gc first and then try to use that for these benchmarks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants