Skip to content

Post-5.00 API for changing minor heap size #11156

@sabine

Description

@sabine

Considering that trunk's semantics of Gc.set for modifying the minor heap size is
"change the minor heap size of the current domain, but all domains created in the future will have the default initial minor heap size (or the one given by OCAMLRUNPARAM s)"
there's the question:

What should the post-5.00 API for changing minor heap size look like?

As @gasche points out in #11142 (comment):

[there can be] heterogeneous workflows when the "main domain", doing most of the work, uses an in-fact-fairly-large minor heap, but we still want "auxiliary domains" around to, say, offload serialization/logging tasks, and for those we don't want a large minor heap

Two operations come to my mind:

  1. set the minor heap size of all domains to the same value.
  2. set the minor heap size of an individual domain.

We already have Gc.set as a knob for tweaking minor heap size, so as I understand, one of these two behaviors should be implemented by Gc.set. Either of those is backwards-compatible.

In trunk, most of the the settings modified by Gc.set are global. There are two exceptions: minor heap size, and stack size, which both, in trunk, operate on the current domain only (from the point of view of the user who doesn't know about the minor heap reservation/reallocation).

  1. Is this what we want, or do we want all operations on Gc.set operate over all domains? I think, for the sake of consistency of the user-facing API, we should go with either "Gc.set applies to the current domain", or "Gc.set applies to all domains".
  2. if we make all operations of Gc.set apply to all domains, where do we add the domain-specific operations? Do we add something like Domain.set_minor_heap_size and Domain.set_stack_size?

Side consideration: What is the more obvious semantics for heap size of new domains created in the future, for both of these minor-heap adjusting operations?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions