[racket] Limit command-line Racket's memory

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Jun 10 16:10:59 EDT 2011

At Fri, 10 Jun 2011 14:51:00 -0400, Tony Garnock-Jones wrote:
> Hi Matthew, everybody,
> 
> On 2011-06-09 7:35 PM, Matthew Flatt wrote:
> > Racket normally relies on memory limits imposed by the OS.
> 
> After I posted my message, I thought to try ulimit. Unfortunately, it 
> didn't help: I couldn't find any setting smaller than all of available 
> RAM within which Racket would even get as far as it was getting with no 
> limit before crashing with an out-of-memory error.

Ok. I think it will be easier to work on base memory use using 3m.

> > With 3m enabled, then custodian-based limits can also constrain
> > memory use.
> 
> These look possibly-interesting, but they mightn't help much in this 
> particular case: they seem more aimed at punishing excessive consumption 
> of a shared resource rather than doing more with less?

A GC should be tried before actually terminating the main custodian. If
that's not what happens currently, we could make it work that way.

> > Finally, the GC can be tuned in various ways to reduce Racket's
> > footprint.
> 
> Ah! Boehm or 3m?

Both, but the knobs vary, and they're all internal right now. The main
Boehm knob is the `GC_free_space_divisor' variable.



Posted on the users mailing list.