-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Post-5.00 API for changing minor heap size #11156
Description
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:
- set the minor heap size of all domains to the same value.
- 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).
- Is this what we want, or do we want all operations on
Gc.setoperate over all domains? I think, for the sake of consistency of the user-facing API, we should go with either "Gc.setapplies to the current domain", or "Gc.setapplies to all domains". - if we make all operations of
Gc.setapply to all domains, where do we add the domain-specific operations? Do we add something likeDomain.set_minor_heap_sizeandDomain.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?