Newsgroups: comp.lang.smalltalk
From: Peter@thalia.demon.co.uk (Peter Long)
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!news.sprintlink.net!demon!thalia.demon.co.uk!Peter
Subject: Smalltalk/V Win32 Low System Memory
Organization: Home
Reply-To: Peter@thalia.demon.co.uk
X-Newsreader: Demon Internet Simple News v1.29
Lines: 46
Date: Wed, 2 Nov 1994 21:12:16 +0000
Message-ID: <783810736snz@thalia.demon.co.uk>
Sender: usenet@demon.co.uk

	Smalltalk/V Win32 Low System Memory Detection

I have a concern regarding the low system memory handling characteristics of 
Digitalk's Smalltalk/V Win32 implementation.  I am in the process of developing 
an application which makes heavy use of run time memory.

Within my application I would like to trap 'out of memory' or 'low memory' 
errors so that some sensible recovery action can be performed.  For instance 
writing any volatile data to disk.

Currently when Smalltalk/V Win32 is unable to fulfil a request for memory, an 
alert box is generated, which when dismissed causes the image to be quit.  
Typical messages include:

Message 5000: out of address space
Message 5001: unable to commit requested pages

Try evaluating something like

OrderedCollection new: 10000000

and see what I mean.

I have tried enclosing expressions such as the above within on: do: statements, 
but these are unable to trap the error.

Examination of the Programming Reference Guide Appendix C, briefly covers low 
system memory.  The general recommendation being that these errors are usually 
fatal and your application should attempt to use less memory.  This is rather 
unhelpful when one is attempting to build an application that is robust to run 
time errors such as these. 
 
Is there anyway within the Exception handling mechanisms of Smalltalk/V Win32 
for these sort of errors to be trapped by the application?  It would be nice to 
generate/detect an exception and handle this accordingly.  Are there any other 
fixes or work arounds that can be used?

I would be grateful for any advice.



Peter Long

-- 
"Quality doesn't have to be defined, you understand it without definition." -  
Robert Pirsig.
