diff --git a/collects/drscheme/private/rep.ss b/collects/drscheme/private/rep.ss index 5e7e4c720b..3b4e4168af 100644 --- a/collects/drscheme/private/rep.ss +++ b/collects/drscheme/private/rep.ss @@ -536,17 +536,22 @@ TODO (make-object string-snip% "[err]")))) (define (no-user-evaluation-message frame exit-code memory-killed?) - ; (printf "memory-killed? ~s\n" memory-killed?) (message-box (string-constant evaluation-terminated) - (if exit-code - (string-append - (string-constant evaluation-terminated-explanation) - "\n\n" - (if (zero? exit-code) - (string-constant exited-successfully) - (format (string-constant exited-with-error-code) exit-code))) - (string-constant evaluation-terminated-explanation)) + (string-append + (string-constant evaluation-terminated-explanation) + (if exit-code + (string-append + "\n\n" + (if (zero? exit-code) + (string-constant exited-successfully) + (format (string-constant exited-with-error-code) exit-code))) + "") + (if memory-killed? + (string-append + "\n\n" + (string-constant program-ran-out-of-memory)) + "")) frame)) ;; insert/delta : (instanceof text%) (union snip string) (listof style-delta%) *-> (values number number) @@ -903,13 +908,7 @@ TODO (user-custodian-parent #f) (memory-killed-thread #f) (user-custodian #f) - (custodian-limit (and (with-handlers ([exn:fail:unsupported? (λ (x) #f)]) - (let ([c (make-custodian)]) - (custodian-limit-memory - c - 100 - c)) - #t) + (custodian-limit (and (custodian-memory-accounting-available?) (preferences:get 'drscheme:limit-memory))) (user-eventspace-box (make-weak-box #f)) (user-namespace-box (make-weak-box #f)) diff --git a/collects/drscheme/private/unit.ss b/collects/drscheme/private/unit.ss index b01dbca5fe..b95132c1bf 100644 --- a/collects/drscheme/private/unit.ss +++ b/collects/drscheme/private/unit.ss @@ -2827,13 +2827,7 @@ module browser threading seems wrong. (λ (_1 _2) (send interactions-text kill-evaluation)) #\k (string-constant kill-menu-item-help-string)) - (when (with-handlers ([exn:fail:unsupported? (λ (x) #f)]) - (let ([c (make-custodian)]) - (custodian-limit-memory - c - 100 - c)) - #t) + (when (custodian-memory-accounting-available?) (new menu-item% [label "Limit memory..."] [parent scheme-menu] diff --git a/collects/string-constants/english-string-constants.ss b/collects/string-constants/english-string-constants.ss index 936c478359..fe480ebdbe 100644 --- a/collects/string-constants/english-string-constants.ss +++ b/collects/string-constants/english-string-constants.ss @@ -1044,10 +1044,13 @@ please adhere to these guidelines: (evaluation-terminated-explanation "The evaluation thread is no longer running, so no evaluation can take place until the next execution.") - ; next two constants show up in the same dialog as the above evaluation-terminated string - ; constants, but only when the user calls 'exit' (possibly with a status code). + ; The next three constants show up in the same dialog as the above evaluation-terminated string + ; constants. + ; The first two show up only when the user calls 'exit' (possibly with a status code). + ; The third shows up when the program runs out of memory. (exited-successfully "Exited successfully.") (exited-with-error-code "Exited with error code ~a.") ;; ~a is filled in with a number between 1 and 255 + (program-ran-out-of-memory "The program ran out of memory.") (last-stack-frame "show the last stack frame") (last-stack-frames "show the last ~a stack frames") (next-stack-frames "show the next ~a stack frames")