Path: utzoo!attcan!uunet!samsung!think.com!linus!linus!linus!mbunix!emery From: emery@aries.mitre.org (David Emery) Newsgroups: comp.lang.modula3 Subject: Re: running out of memory Message-ID: Date: 11 Feb 91 14:02:11 GMT References: <9102080401.AA29237@jumbo.pa.dec.com> Sender: news@linus.mitre.org (News Service) Organization: The Mitre Corp., Bedford, MA. Lines: 23 In-Reply-To: doug@snitor.uucp's message of 8 Feb 91 17:42:23 GMT Nntp-Posting-Host: aries.mitre.org Ada provides an exception (STORAGE_ERROR) that is raised when the allocator cannot return any memory. I have likened this to a parachute that opens on impact, in that it meets its absolute requirements but is unusable in most practical situations. It is not enough to have an exception, you also have to define what can be done to handle the exception. In the case of Ada, STORAGE_ERROR can be raised in (at least) 2 circumstances: 1. out of heap 2. out of stack There is no good way to tell the difference between these two occurances. Furthermore, if you've run out of stack, you probably can't do anything at this point, because anything interesting (such as calling a cleanup routine) would require more stack space. My point here is that if you want to be able to recover from storage exhaustion, you need more than notification. You also need some understanding of what is permissible and not permissible after the exception has been raised. Finally, you'd like very much to have this defined in such a way that your program is portable (i.e. maybe the language should define a minimum permissible set of operations/actions, which can be extended by an implementation.) dave emery