50.1.1
by Rodolfo Carvalho
Add example to show how to limit memory usage |
1 |
#lang racket |
2 |
||
3 |
(define cust (make-custodian)) |
|
4 |
(custodian-limit-memory cust (* 20 1024 1024)) ;; limit memory usage to 20MB |
|
5 |
(parameterize ([current-custodian cust]) |
|
6 |
(let loop ([lst '()]) |
|
7 |
(loop (cons (random 2) lst)))) |