
The `current-memory-use' function's result now includes the memory use of places created from the calling place, and custodian memory limits apply to memory use by places (owned by the custodian). This change is relevant to PR 12004 in that DrRacket will no longer crash on the example if a memory limit is in effect, but plain Racket starts with no such limit and will exhaust all memory.
17 lines
398 B
Racket
17 lines
398 B
Racket
#lang racket/base
|
|
(require racket/place)
|
|
|
|
(provide main runaway)
|
|
|
|
(define (main)
|
|
(parameterize ([current-custodian (make-custodian)])
|
|
(custodian-limit-memory (current-custodian) (* 1024 1024 64))
|
|
(parameterize ([current-custodian (make-custodian)])
|
|
(place-wait (place ch (runaway))))))
|
|
|
|
(define (runaway)
|
|
(printf "starting\n")
|
|
(define p (place ch (runaway)))
|
|
(place-wait p))
|
|
|