stephenrkell / liballocs

Meta-level run-time services for Unix processes... a.k.a. dragging Unix into the 1980s
http://humprog.org/~stephen/research/liballocs
Other
216 stars 26 forks source link

MMTk integration desired #78

Open stephenrkell opened 11 months ago

stephenrkell commented 11 months ago

For a long time I've wanted high-performance garbage-collected heaps to be available and integrated with liballocs -- especially as a foundation for multi-language interop. It is looking like MMTk could provide a great way to achieve this.

There is an open call for liballocs-related projects within MMTk here. This issue is the converse call to the liballocs audience (such as it is).

One initial set of goals is roughly this:

We can add more goals later, especially about what should perform well.

I'll add notes below about what I manage to get done, or just to understand, during early investigations of MMTk and liballocs.

stephenrkell commented 3 weeks ago

One possible overlap is the approach to classifying pointers at the top level. In MMTk there is a 4MB notion of "chunks" that is used to keep track of memory-mapping-granularity divisions of memory. In liballocs we use the pageindex, which has finer granularity (one page, as we'd expect) but a similar purpose... and behind the pageindex are big_allocations of course. Maybe we'll find that we can use one in place of the other (probably the pageindex in place of an chunk-associative structure, but that's not 100% clear yet).

stephenrkell commented 3 weeks ago

A more extreme idea is this: can we implement the MMTk memory manager interface using liballocs? This would mean that any memory known to liballocs would be queryable or manipulable via MMTk's interface, i.e. backing onto liballocs's base- and meta-level APIs. Is this useful?

Like liballocs, MMTk encapsulates memory management with a mixture of base-level actions on memory (free) / objects (allocated), and somewhat-meta-level queries on objects (closed) / addresses or address ranges (open).

stephenrkell commented 3 weeks ago

Flipping it around, we can also ask: given a Plan (in MMTk-speak), or possibly a Builder or MMTK (not sure), can we generate a struct allocator (in liballocs-speak)?

stephenrkell commented 2 weeks ago

Now I understand a tiny bit more about MMTk, here are some thoughts.