[comp.sys.apple] Program Hangups

jshaver@APG-5.ARPA (John Science Fiction & Resume Service Shaver) (05/04/87)

Sometimes programs use the string facilities of Applesoft.  When Garbage
collection is required, the system appears to hang up for several minutes.

a228arig@cdfb.utoronto.UUCP (05/06/87)

>
> Sometimes programs use the string facilities of Applesoft.  When Garbage
> collection is required, the system appears to hang up for several minutes.
>
>

Yes, that happens when you start having very large programs.  There are a
few ways around it.  I think the Apple manual suggests that you 'force'
garbage collection periodicaly by using 'FRE(0)'.  FRE(0) returns the
available memory space, but it has the side effect of collecting garbage.
So a line like:

        300 G=FRE(0)

scattered throughout your program may help.  Incidentally (according to
the manual), the argument in FRE makes no difference to the function, but
it must be legal since it gets evaluated.

Probably a better way, is to use a faster garbage collection routine written
by other people.  The one that comes to mind is something from the makers
of Diversi-Dos.  I think that newer versions of their DOS has some
garbage collection routine built in, or on the disk...  (not absolutely
certain though.)

--Tak

-----------------------------------------------------------------------------
UUCP:     {utzoo, decvax, ihnp4, cbosgd, utcsri, mnetor}!utgpu!utcdfa!cssu
ARPAnet:  cssu%cdfa.toronto.edu@relay.cs.net
CSnet:    cssu%cdfa.toronto.edu
BITNET:   cssu@utcdfa.UTORONTO
==  University of Toronto -- Toronto, Canada  ==
-----------------------------------------------------------------------------

george@genat.UUCP (George Gorsline) (05/08/87)

FRE(0) will give free space
FRE(" ") will force garbage collection and then give free space

There is a difference!
	
George Gorsline, Jr.  VE3FIU / K8HI
	One of the VE3YDX gang... Y DX?  Because it's there(~Y)!
			__... ...__  . ...  _.. _.._
	Genamation, 351 Steelcase Rd. West, Markham Ontario L3R 3W1
	{allegra|linus|ihnp4|...}!utzoo!mnetor!genat!george
	(416) 475-9434

hayes@wizard.ucsd.edu (James Hayes) (05/09/87)

george@genat.UUCP (George Gorsline) writes in article <153@genat.UUCP>:
>FRE(0) will give free space
>FRE(" ") will force garbage collection and then give free space
>
>There is a difference!

The last time I checked my Applesoft source code (unofficial, produced
by Southwestern Data Systems) "fre" doesn't check it's arguments.
BUT!!!! Prodos, DOES change this.  (The same way PRODOS intercepts
"hgr" commands to handle memory allocation.)

Key point: What fre() you get depends on what DOS you use.

Jim Hayes, Univeristy of California at San Diego.

BITNET: hayes%sdcsvax@WISCVM.BITNET
ARPA:	hayes@sdcsvax.ucsd.edu
UUCP:   {pick one close to berkeley}!sdcsvax!hayes