[MLton-user] Real Time MLton

Stephen Weeks sweeks@sweeks.com
Fri, 16 Apr 2004 08:31:31 -0700


> > Multiple garbage collection strategies (copying, mark compact,
> generational).
> 
> Could you elaborate more these different GC algorithms MLton can use?

If there is lots of heap space available (i.e. a high ratio of heap
spice to live data), MLton uses two-space breadth-first copying GC.
If the heap space gets tighter, MLton switches to generational GC with
two generations and breadth-first copying for both generations.  If
heap space gets even tighter, MLton uses mark-compact GC for the old
generation.

> Are any  of them suitable for Real Time Systems?
> How can we make MLton as a Real Time language?

We didn't put any thought into making MLton real time when designing
the runtime.  So, I doubt it's suitable.  There are other kinds of GC
that are out there that might be better for real time.  Taking a wild
guess, it would be a couple months work to hook in a new GC to MLton.

The only other point I can make is the obvious one that if you bound
the size of the heap, which you can do with MLton's fixed-heap or
max-heap runtime argument, then you can bound the time it takes for a
GC.  Whether or not this is sufficient for your application depends on
the size of the heap.