Skip to content

Means of limiting how much memory is being reserved by the runtime, so that Valgrind and AFL can be used #10971

@sabine

Description

@sabine

It became clear in #10955 that a proper functionality and design discussion needs to happen.

Feature Proposal

We need a means of limiting how much memory is being reserved by the runtime, so that we can run Valgrind and AFL.

In general, it would be good to give the programmer more control over the amount of virtual memory that the OCaml runtime reserves.

@kayceesrk in ocaml-multicore/ocaml-multicore#795
Currently, both [Max_domains and Minor_heap_max] 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.

Failed Implementation

Goals

  • No limit on the number of domains that can be spawned
  • No limit on the the program changing the size of the minor heap
  • No new OCAMLRUNPARAM parameters
  • Valgrind works out of the box, AFL works with the -m none option

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