[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Garbage Collection



In article <3k21bu$afq@acme.freenet.columbus.oh.us>,
Dave Althoff <dalloff@freenet.columbus.oh.us> wrote:
> 
> That must be it.  I didn't change any of the memory settings or anything
> else.  My guess is that BASIC.SYSTEM, or possibly something in GS/OS (I
> had come to BASIC.SYSTEM from the Finder), had marked some of the P8
> buffer space while my program was running.

Nothing to do with GS/OS - it puts some minor patches into the ProDOS
kernel, but doesn't touch applications (including BASIC.SYSTEM).

The marking of used pages is only done by your own programs -
BASIC.SYSTEM doesn't do it automatically (apart from setting up the
initially protected areas, which include its code and low memory), and
neither does ProDOS.

> It opened *one* file, read all the data from it, closed it, then
> manipulated the data.  Then it tried to open *one* new file and write
> out the manipulated data, and crashed with NO BUFFERS AVAILABLE.

Probably just out of memory - you didn't have 1k of free RAM left to
allocate a buffer.  BASIC.SYSTEM should do a garbage collection before
trying to open the file, so you must have been really low on memory.

Maybe it doesn't do an automatic garbage collection.  I'll have to
look in BASIC Programming with ProDOS to see what it says.

Had you fiddled with HIMEM or LOMEM at all?  Changing HIMEM in ProDOS
is a bad move (you can do it as long as you are very careful, know
what is going on internally, and use a multiple of 256 bytes).
Changing LOMEM is fine, as long as you don't run out of memory in the
process.

> Obviously a bogus error, since I was able to use ProDOS commands from
> the command line.  Hmmm... 

Assuming you hadn't done a NEW, CLEAR or RUN prior to this, the
implication is that BASIC.SYSTEM doesn't do an automatic garbage
collection before opening a file, but one was performed before you
could type in the next disk command.

Actually - CATALOG would probably work, because it uses the general
purpose buffer.  Further file commands might not work, unless they
freed memory first (e.g. RUN).
-- 
David Empson
dempson@actrix.gen.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand