Developers » Ancient

Ancient is an OCaml module that allows you to use in-memory data structures which are larger than available memory and so are kept in swap. If you try this in normal OCaml code, you'll find that the machine quickly descends into thrashing as the garbage collector repeatedly iterates over swapped memory structures. This module lets you break that limitation. Of course the module doesn't work by magic :-) If your program tries to access these large structures, they still need to be swapped back in, but it is suitable for large, sparsely accessed structures.

Secondly, this module allows you to share those structures between processes. In this mode, the structures are backed by a disk file, and any process that has read/write access to that disk file can map that file in and see the structures.

Find out more about this module in these release notes: ancient-readme.txt

Download

The license is LGPL + OCaml linking exception. This module contains portions of the mmalloc library developed by Mike Haertel and Fred Fish which was included in GDB. mmalloc is licensed under the LGPL.

Old versions

Experimental patch for x86_64, objects larger than 2^31 bytes

Jason Ganetsky noticed that the mmalloc library (a part of Ancient) has trouble handling allocations over 231 bytes in size. (Note: Does not affect the total size, just if you have a single OCaml object such as a string or array which is very large). ancient64.diff is an experimental patch from Jason to fix this.

Experimental patch for Windows

Dmitry Bely sent this patch which adds some support for Windows. (It doesn't support shared mappings however since mmap-related calls require some significant porting effort).

ancient-windows.diff

Experimental patch - various fixes

Christopher Cramer sent me a patch which generally improves the code. You can read more in his description at the top of the patch file:

ancient-tsuyoshi.patch

Merjis

effective marketing for the web

Merjis specialises in innovative marketing,
accessibility, search engine optimisation (SEO),
and development for the web.