On 11/27/2017 3:30 PM, Zelphir Kaltstahl wrote:

Memory limits can be easily added to a program as well with the following code:

(define (Mb-to-B n) (* n 1024 1024))
(define MAX-BYTES (Mb-to-B 128))
(custodian-limit-memory (current-custodian) MAX-BYTES)

The problem with  custodian-limit-memory  is that it doesn't actually limit how much memory the custodian can allocate - the limit is enforced only *after* GC runs.  Between GC runs, the custodian could allocate far more than the limit.

I'd like a command line switch that puts a hard limit on heap size ... similar to the server JVM.  Using ULIMIT on Linux you can restrict process data size, but Windows offers no simple way to do that.  It can be done clumsily on Windows using containers or with "job objects", but few people have containers set up on their Windows boxes and the few job objects tools I am aware of work only on already running processes ... there's no simple way to start a process that is restricted from the beginning.


You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to