[comp.sys.mac.programmer] Memory Manager INIT?

osborn@ux1.lbl.gov (James R Osborn) (06/06/91)

I was using the Memory Manager INIT with my IIci prior to installing
System 7.  The documentation that came with the init did a nice job
(I thought) of explaining what was wrong with the memory manager on
various Macs including the IIci.  The problem made it very inefficient
under certain circumstances when allocating memory (Ptrs and Handles).

I'd like to know from someone in the know if this really was or is a
problem with the ROMs for certain machines?  Has System 7 patched or
otherwise corrected the memory manager so that this init is no longer
necessary?  If not, then is this init approved of by anyone at Apple
for correcting the problem?

-- James

.------------------------------.--------------------------------------.
| James R. Osborn              | It just goes to show you it's always |
| Lawrence Berkeley Laboratory | something.  Either it's baffling     |
| osborn@ux1.lbl.gov           | tech notes or your mac is smoking.   |
| (415) 548-8464               | It's always something...             |
'------------------------------'--------------------------------------'

gad@eclipse.its.rpi.edu (Garance A. Drosehn) (06/06/91)

In article <13953@dog.ee.lbl.gov> osborn@ux1.lbl.gov (James R Osborn) writes:
> I'd like to know from someone in the know if this really was or is a
> problem with the ROMs for certain machines?  Has System 7 patched or
> otherwise corrected the memory manager so that this init is no longer
> necessary?  If not, then is this init approved of by anyone at Apple
> for correcting the problem?

It really was a problem on some machines (my Mac IIci for instance), but the  
problem is only noticable with a very small number of programs.  Like, two or  
three different programs.  If you did not notice a dramatic speed improvement  
in anything you did after installing the init, then chances are the problem did  
not really effect you at all.

These problems are fixed with system 7.  Do not even think of using the init if  
you are running system 7.  System 7 fixes the same things, and includes other  
changes which you'll only lose if you install the init.  You'll definitely make  
your life worse if you run this init with system 7.

If you're still running system 6 then you can think about it, but it isn't  
really a good idea.  It's quite possible that running the init with system 6  
will cause you more problems then it will solve.  In my case it was worth  
running the init, but for the vast majority of Mac users it is not.

 -  -  -  -  -  -  -  -
Garance Alistair Drosehn   = gad@rpi.edu  or  gad@eclipse.its.rpi.edu
ITS Systems Programmer                       (handles NeXT-type mail)
Rensselaer Polytechnic Institute;  Troy NY  USA

mjohnson@Apple.COM (Mark B. Johnson) (06/06/91)

In article <13953@dog.ee.lbl.gov> osborn@ux1.lbl.gov (James R Osborn) writes:
>
>I was using the Memory Manager INIT with my IIci prior to installing
>System 7.  The documentation that came with the init did a nice job
>(I thought) of explaining what was wrong with the memory manager on
>various Macs including the IIci.  The problem made it very inefficient
>under certain circumstances when allocating memory (Ptrs and Handles).
>
>I'd like to know from someone in the know if this really was or is a
>problem with the ROMs for certain machines?  Has System 7 patched or
>otherwise corrected the memory manager so that this init is no longer
>necessary?  If not, then is this init approved of by anyone at Apple
>for correcting the problem?
>

Since this questions keeps coming back and I know Keith is tired of
answering it, following is the official Apple position on the MMInit
which many of you are still using (and should not be).  What follows
is the official position, but the basic word is do not use it under
either System 6.0.x or System 7.0.

__________

Under System 6.0.x, Apple had identified a minor problem with the Memory Manager
in the Macintosh IIfx, IIci, IIsi and LC. This problem resulted in a performance
degradation in an extremely small number of applications and did not cause
system crashes. We believe this was an insignificant problem that affected few
applications and very few customers. The problem was not new and was not caused
by the introduction of System Software 6.0.5 or 6.0.7.

Based on developer feedback, customer feedback, and extensive in-house testing,
Apple has identified very few affected applications. Because the problem only
affects an extremely small number of developers, Apple is working with those
developers to fix their applications.  The best solution, however, is to upgrade
to System 7.0, as it includes an enhancement to the Memory Manager to address
this issue.

During extensive testing and research, Apple investigated a variety of solutions
to enhance the Memory Manager performance. One area researched was a software
solution called the Memory Manager INIT (a software "patch") or MMInit as it is
most often called. Through testing we discovered that this patch did not enhance
Memory Manager performance and introduced risks such as decreased performance in
some mainstream applications.

An unofficial version of the Memory Manager INIT has surfaced. This INIT should
not be used, because it has been modified from Apple's experimental version and
could cause data corruption, data loss, and crashes. Apple strongly urges that
you discard the INIT if you have obtained a copy, and not use it.  If any
version of this INIT is used under System 7.0, it defeats the enhanced Memory
Manager and reintroduces the bugs which where present in the System 6.0.x Memory
Manager.

You may still wonder if you have been affected by this and how to avoid it under
6.0.x. The problem is most severe when allocating pointers in a heap with a
rather large number of handles (on the order of tens of thousands). It's helpful
to allocate enough master pointers (via MoreMasters) during initialization. If
the Memory Manager has to call MoreMasters later on, not only could it fragment
memory, but it could take an exceedingly long time. It's also helpful not to
allocate thousands of handles. Besides requiring lots of master pointers, it
takes the Memory Manager a long time to crunch through them during heap
compaction.

Chances are you're not being plagued by this rare "bug." Before you go crazy
wondering if the "bug" exists in your computer, read and check the following
list of factors affecting CPU performance:

  %  Monitor size, bit depth, color or black and white
  %  On-board video versus video card
  %  Hard disk size, fragmentation, interleaving (which CPU
     the hard disk was initialized on, and which CPU is now using it)
  %  AppleTalk active
  %  Servers mounted
  %  Electronic mail installed
  %  Public Folders (shared folders)
  %  INITs installed
  %  Fragmented heap (other applications could fragment/corrupt
     the system heap)
  %  Amount (and speed) of RAM
  %  Mixing speeds of RAM (causes random crashes)
  %  Finder vs. MultiFinder
  %  Disk cache
  %  Cache cards installed
  %  Floppy disk access
  %  Peripherals connected (such as CD-ROM and tape drives)
  %  Background printing

If you're indeed experiencing a performance proglem, make sure that the above
conditions are not contributing to it.
__________

-- 
Mark B. Johnson                                            AppleLink: mjohnson
Developer Technical Support                         domain: mjohnson@Apple.com
Apple Computer, Inc.         UUCP:  {amdahl,decwrl,sun,unisoft}!apple!mjohnson

"You gave your life to become the person you are right now.  Was it worth it?"
                                                         - Richard Bach, _One_

keith@Apple.COM (Keith Rollin) (06/07/91)

In article <13953@dog.ee.lbl.gov> osborn@ux1.lbl.gov (James R Osborn) writes:
>
>I was using the Memory Manager INIT with my IIci prior to installing
>System 7.  The documentation that came with the init did a nice job
>(I thought) of explaining what was wrong with the memory manager on
>various Macs including the IIci.  The problem made it very inefficient
>under certain circumstances when allocating memory (Ptrs and Handles).
>
>I'd like to know from someone in the know if this really was or is a
>problem with the ROMs for certain machines?  Has System 7 patched or
>otherwise corrected the memory manager so that this init is no longer
>necessary?  If not, then is this init approved of by anyone at Apple
>for correcting the problem?

Excutive summary:

- There really was a problem in the LC, IIsi, IIci, and IIfx.
- System 7.0 fixes the problem.
- The problem affects only 2 or 3 programs. If you aren't running
  them, then you will not see a problem. None of these programs
  are in the "Top 100 Macintosh Programs of All Time".
- DON'T run the init under 7.0, as it will re-introduce bugs that
  7.0 fixes.
- The INIT was written as a test to see if the specific bug in
  question could be fixed. In its current form, it was never
  intended to leave Apple, and was never tested. Although it was
  written by someone at Apple (me), it is in no way approved.

-- 
------------------------------------------------------------------------------
Keith Rollin  ---  Apple Computer, Inc. 
INTERNET: keith@apple.com
    UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith
"But where the senses fail us, reason must step in."  - Galileo

osborn@ux1.lbl.gov (James R Osborn) (06/08/91)

In article <53702@apple.Apple.COM> mjohnson@Apple.COM (Mark B. Johnson) writes:
>In article <13953@dog.ee.lbl.gov> osborn@ux1.lbl.gov (James R Osborn) writes:
>>
>>I was using the Memory Manager INIT with my IIci prior to installing
>>System 7.  The documentation that came with the init did a nice job
>>(I thought) of explaining what was wrong with the memory manager on
>>various Macs including the IIci.  The problem made it very inefficient
>>under certain circumstances when allocating memory (Ptrs and Handles).
>>
>>I'd like to know from someone in the know if this really was or is a
>>problem with the ROMs for certain machines?  Has System 7 patched or
>>otherwise corrected the memory manager so that this init is no longer
>>necessary?  If not, then is this init approved of by anyone at Apple
>>for correcting the problem?
>>
>
> [...]
>
>If you're indeed experiencing a performance proglem, make sure that the above

Mark, thanks for the info., but what's a ... ^^^^^^ ?
(I'm not sure if I'm experiencing any of those  8^)

>conditions are not contributing to it.
>__________
>
>-- 
>Mark B. Johnson                                            AppleLink: mjohnson
>Developer Technical Support                         domain: mjohnson@Apple.com
>Apple Computer, Inc.         UUCP:  {amdahl,decwrl,sun,unisoft}!apple!mjohnson
>
>"You gave your life to become the person you are right now.  Was it worth it?"
>                                                         - Richard Bach, _One_

Is it not fair to tell us the name of those "very-few-and-not-in-the-Top-100-
Macintosh-Programs-of-All-Time" programs that did have problems?  You don't
have to answer that if you don't want to, I'm certain I'm not using one the
programs in question - just curious.

-- James

.------------------------------.--------------------------------------.
| James R. Osborn              | It just goes to show you it's always |
| Lawrence Berkeley Laboratory | something.  Either it's baffling     |
| osborn@ux1.lbl.gov           | tech notes or your mac is smoking.   |
| (415) 548-8464               | It's always something...             |
'------------------------------'--------------------------------------'