OCaml Ancient

Alex, 30 Dec 2013

OCaml has minor and major heaps. The minor heap is for short-lived things and major is for long-lived things. The Ancient library introduces an "ancient" heap for in-memory objects that are too big for memory.

You manually mark objects as ancient. When you do this, the library creates a new heap that is not traversed by the GC.

This is implemented as a library in OCaml.

That's just crazy.

My friend Jamie Brandon used it in texsearch to stop the GC from trying to traverse a 12 gigabyte suffix tree.

comments powered by Disqus