Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Modula 3 > Re: exception w...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 64 of 149
Post > Topic >>

Re: exception when NEW fails

by "Rodney M. Bates" <rodney.bates@[EMAIL PROTECTED] > Oct 31, 2003 at 10:28 PM

I have thought about this on several occasions (graceful recovery from
running out of memory), and I think it is quite difficult.  The problem
is that most of the things you would want to do to recover are likely
to require additional allocations themselves.  Popping up dialogs and
opening files to save data are obvious examples.

To make it worse, the allocations will be done deep inside library code
for the GUI system, IO, etc.  So if yoy try to reserve some space for
emergnecies,  this library doesn't have any easy way to know whether
this is an emergency or not.

The only thing I can think of would be to add some functions and interface
to the allocator itself so it can:

1) be asked to set aside a reserve for emergencies

2) be informed it is now an emergency, whereupon it would start
    allocating from the reserve.

I want to note that this is _virtual_ memory, which on current machines
is usually plentiful.  I suspect most programs just depend on having so
much virtual memory that running out is very unlikely.  It is also
likely that a program will be so seriously page-thra****ng before this
happens, that the user gives up for that reason first.

Henning Thielemann wrote:
> I've learned from the a discussion years ago
> 
http://groups.google.de/groups?hl=de&lr=&ie=UTF-8&threadm=NAYERI.95Jun9115820%40bermuda.gte.com&rnum=3&prev=/groups%3Fq%3Dcallback%2Bexception%2Bgroup:comp.lang.modula3%26hl%3Dde%26lr%3D%26ie%3DUTF-8%26group%3Dcomp.lang.modula3%26selm%3DNAYERI.95Jun911582
>  that it is intended that the program is aborted unrecoverably if it
runs
> out of memory. This is not acceptable for GUI driven programs - the
> program cannot simply quit if the user enters a zero too much for a size
> value ... What is the current implementation in pm3 and cm3 ?
> 
> 

-- 
-------------------------------------------------
Rodney M. Bates      rodney.bates@[EMAIL PROTECTED]
 Professor and Graduate Coordinator
Computer Science, Box 83 Wichita State University
1845 Fairmount, Wichita KS 67260-0083
316-978-3922
 




 3 Posts in Topic:
exception when NEW fails
Henning Thielemann <ia  2003-10-07 10:07:51 
Re: exception when NEW fails
Olaf Wagner <wagner@[E  2003-10-20 06:43:51 
Re: exception when NEW fails
"Rodney M. Bates&quo  2003-10-31 22:28:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 0:17:34 CDT 2008.