When did OCaml start using mmap for heap allocation?


I believe OCaml uses mmap to allocate memory but used to depend on malloc. At least OCaml 4.02 seems to have used malloc but I could not find in the Changes file when this change was introduced and would be curious. I had asked about GC details at A lesson from Ruby's GC? and learned about OCaml now using mmap, which shields it from assumptions made by malloc.


3.08 had it already

It was implemented in 3.05 it seems.


And it looks like it was enabled by default:

This puzzles me because I see a huge impact by using jemalloc instead of glibc malloc in a program compiled with OCaml 4.02.

1 Like