added a message in the 'program is shutdown' dialog that indicates if it ran out of memory

svn: r6097
This commit is contained in:
Robby Findler 2007-04-29 22:09:07 +00:00
parent 5ac3fdd86e
commit 6e256634b9
3 changed files with 21 additions and 25 deletions

View File

@ -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))

View File

@ -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]

View File

@ -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")