Skip to content
This repository was archived by the owner on Jun 21, 2024. It is now read-only.
This repository was archived by the owner on Jun 21, 2024. It is now read-only.

Make Minor_heap_max and Max_domains as OCAMLRUNPARAM options #795

@kayceesrk

Description

@kayceesrk

Currently, both of these are defined in runtime/caml/config.h, with Minor_heap_max defined as 2GB and Max_domains as 128. This makes Multicore OCaml programs use at the minimum 256GB of virtual address space. This causes problems for tools like AFL and Valgrind, which cannot seem to deal with mmap reserve and expects to commit that much memory, and hence run out of memory on Multicore OCaml.

My proposal is to make both Minor_heap_max and Max_domains as OCAMLRUNPARAM options (whose default values can remain the same as now). With that change, we will be able to use AFL and Valgrind without having to have a separate compiler switch where these macros are defined to have much smaller values.

AFL would use Max_domains as 1, and Minor_heap_max to a small default such as 2 MB (non-determinism with multiple domains will affect AFL stability). Similarly, for valgrind, one you use a smaller Minor_heap_max. I have confirmed that both AFL and valgrind work with Max_domains as 1 and Minor_heap_max as 2 MB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    post-MVP for 5.00Items that need to be done before 5.00 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions