[futurebasic] Re: List Memory Leaks in PG

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 1998 : Group Archive : Group : All Groups

From: Alessandro Medici <alexmed@...>
Date: Wed, 18 Mar 1998 07:39:21 +0200
>>Help
>>I've written a grading program using PG and in one of the main interface
>>windows uses two list boxes. Standard PG string utilites care called
>>frequently to manage the contents of the lists. Everythings seems to
>>work fine BUT users of the program report that crashes occur after
>>continuous use (this is a grading program so hundreds of string changes
>>occur). I used a program called Swatch to monitor the memory usage of
>>the program while it runs. I found that each hit to the list boxes costs
>>320 bytes of free memory as the string resources are changed - just like
>>it said it would in PG manual!
>>
>
>snip

Better:
at launch you set an area of memory reserved for you with a call to

0) myReservedHandle = newhandle (_QuantityBetterForYou)...

>Before or after hitting the list:
>
>1) make a call to:
>sizeMyList = fn gethandlesize(..., yourListsize,...)
>
>2) make a call to:
>probehandle = newhandle (....., 2/3 * yourListsize,........)
>
>3 if     ) if you have memory problem, then probehandle = 0,
dispose your myReservedHandle,  advise your user that the program have a
family's meeting with is wife for a memory problem, then save, quitting,
>and restart. (this is a Ross Lambert trick in a old IB).
>
>3 else) else dispose the probehandle
>
>
>
>
>Blip, blop....
>
>
>		Ciao!
>
>
>	Ciao, Alessandro
>
>
>
> Alessandro dr Medici
>             Via Zanotto 23
>30120   Venezia, Italy
>
>041/987,339
>033/55293827
>0368/208673 not.int (many expensive)
>
>
>			_______________________________
>
>
>			...vuolsi cosi', cola' ove si puote
>
>			cio' che si vuole, e piu' non dimandare...
>
>			_______________________________
>
>
>--
>To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>



	Ciao, Alessandro



 Alessandro dr Medici
             Via Zanotto 23
30120   Venezia, Italy

041/987,339
033/55293827
0368/208673 not.int (many expensive)


			_______________________________


			...vuolsi cosi', cola' ove si puote

			cio' che si vuole, e piu' non dimandare...

			_______________________________