[net.micro.amiga] Releasing Memory

CC.KASSEBAUM@R20.UTEXAS.EDU (12/04/85)

From: CC.KASSEBAUM@R20.UTEXAS.EDU


	What is the correct sequence to release memory in an AMIGA program.
	It seems that after running the our program, there is less memory
	left.

	Regards,	Don K
-------

bruceb@amiga.UUCP (Bruce Barrett) (12/04/85)

In article <622@caip.RUTGERS.EDU> CC.KASSEBAUM@R20.UTEXAS.EDU asks:
>
>	What is the correct sequence to release memory in an AMIGA program.
>	It seems that after running the our program, there is less memory
>	left.
The simple answer is: "Put back what you took."  But I suspect you and others
are already doing this.

The next question I'd ask is "how much do you loose?"

54 bytes and small multiples there of
------------------------------------- are "Intuimessages".  Intuition tries
to hold on to these for a while (it uses them a lot and it saves it from
doing memory allocations/deallocations).

~1k to 20k(or more??) 
--------------------Could easily be the result of a library or device 
being opened, called and expunged.  But this is "well behaved!" I hear 
you cry.  Yes, it is.  What is going on is the library or device does
not get unloaded until its memory is needed.  Soooo... to see whether
or not you really are a core hog you need to force all excess libraries
and devices out of memory.  One way of doing this is to "grab for all
the RAM you can get".  Try doing an 8 or 16 meg memory allocation.  The
system will clear out anything and everything that it thinks it doesn't
need.  ---This is why it is VERY important to close what you open.  If
you don't the system will think it is still in use.---

printer.device + parallel.device + generic_printer_driver = ~ 21.5k (wow!)

Fonts can give the appearence of "lost" memory too, just like devices.

Hope this helps!	--BruceB