[racket] Limit command-line Racket's memory

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Jun 9 19:35:27 EDT 2011

At Thu, 09 Jun 2011 18:08:22 -0400, Tony Garnock-Jones wrote:
> I'm running racket (from git) from the command-line on a machine with 
> 64MB RAM. The 3m collector is not (yet) supported on the machine - it's 
> a MIPS-based CPU.
> When I start the web-server, it loads and runs OK up until it tries to 
> fork() for a (process*) call, at which point it fails with out-of-memory 
> since it has only left about 1MB for the rest of the system.
> Is there some way of limiting the memory Racket will try to use to, say, 
> 32MB? Perhaps an environment variable, command-line flag or compile-time 
> preprocessor definition?

Racket normally relies on memory limits imposed by the OS. With 3m
enabled, then custodian-based limits can also constrain memory use.
Finally, the GC can be tuned in various ways to reduce Racket's

In this case, it sounds like we should start by making 3m work. I
imagine you're using a Linux-based system, so it should be easy. Let's
take that off-list and then resume here.

Posted on the users mailing list.