[comp.sys.mac] Why does the system heap grow with multifinder and System 4

LaserMan@cup.portal.com (08/31/88)

The *feature* you describe, not releasing memory when applications are quit
in Multifinder is documented in the MultiFinder release documentation. I have
always considered this to be a bug. It is know in most circles as a
'Core leak' and is definitily bad practice. But since it is documented it must
be a feature...SMILE.

Bob Murrow
LaserMan@cup.portal.com

drew@cup.portal.com (08/31/88)

Re: the following question and answer, a comment follows below:
-------------------------------------------------------------------------
In article <12422786824.175.G.GUTOW@LEAR.STANFORD.EDU> G.GUTOW@LEAR.STANFORD.EDU (Jonathan Gutow) writes:
>I'm using system 4.2 and multifinder on an old mac upgraded with the 128K
>ROMs and an 800K disk drive.  I've noticed that initially on switch launching
>to multifinder the system heap takes up about 252K of memory.  After I've
>started and quit afew applications such as RedRyder and WriteNow(1.07 patched
>for multifinder) the heap size gains about 100K.  It seems to me that
>when you are back to a minimal configuration of running the finder and the
>system the system heap size should collapse back down to its original size.

There are two possible reasons:
1) Some applications tend to lock system resources and don't release them
   when they exit.  This tends to cause a slow increase in system heap usage.
   It can only be fixed by fixing the applications.
2) MultiFinder doesn't reduce the system heap unless there is a good reason
   to do so.  So, if you don't need the memory, MultiFinder will keep it in
   the system heap.

						_emt
------------------------------------------------------------------------
Knowing nothing about the Mac OS, I will stick my neck out with these
comments:
1)  Why can it "only be fixed by fixing the applications"?  The reasonable
thing for an OS to do would be to track allocation of resources (by
application, process, job, etc.) and free them when the allocator terminates.
Perhaps Mac OS doesn't in fact do this, but it certainly could (and
should, maybe).
2)  Seems like a strange statement:  doesn't reduce the heap unless there's
a good reason.  Isn't the fact that someone de-allocated the memory a
good reason?  Why would the system want to hang on to it?  Won't that cause
problems for applications and others?  e.g., suppose someone makes a request
to determine how much memory is available (as the original questioner
above apparently did), he'll get the wrong answer.
Again, I know nothing of Mac internals, so maybe there's a good reason
for the above behavior, but it seems strange to me.

goldman@Apple.COM (Phil Goldman) (09/02/88)

In article <8585@cup.portal.com> LaserMan@cup.portal.com writes:
>The *feature* you describe, not releasing memory when applications are quit
>in Multifinder is documented in the MultiFinder release documentation. I have
>always considered this to be a bug. It is know in most circles as a
>'Core leak' and is definitily bad practice. But since it is documented it must
>be a feature...SMILE.

The point is, many of these resources could be used by the applications that
are still running.  Therefore, it is a waste of time to throw them out until
there is no other space left, as they will just have to be loaded from the
disk again.  Probably the mistake that was made was to show the "System"
memory bar in the Finder about box, or else we should not have included
resources that could be reclaimed in this category.

-Phil Goldman
Apple Computer