[comp.sys.mac.programmer] Help with SIZE resource

meynard@IRO.UMontreal.CA (Meynard Yves) (03/12/91)

To all those out there wiser than I :

One of the last touches tbefore we (finally) release our application here
is to add a SIZE resource. However, after trying various setups (usually
copied from commercial apps like PageMaker et al), we still can't figure
out how the last two fields work (suggested and minimum memory). If you
understand them clearly, and can put it in writing even more clearly
please let me hear from you! Thanks in advance to all those who respond.

Serge Meynard
(guest of Yves Meynard)

peirce@outpost.UUCP (Michael Peirce) (03/14/91)

In article <1991Mar12.052919.12389@IRO.UMontreal.CA>, meynard@IRO.UMontreal.CA (Meynard Yves) writes:
> 
> One of the last touches tbefore we (finally) release our application here
> is to add a SIZE resource. However, after trying various setups (usually
> copied from commercial apps like PageMaker et al), we still can't figure
> out how the last two fields work (suggested and minimum memory). If you
> understand them clearly, and can put it in writing even more clearly
> please let me hear from you! Thanks in advance to all those who respond.

The suggested size is the amount of memory MultiFinder will assign
your App if it can.  For example, you are running on a Mac with 6
Meg free, but your App has a suggested size of 2 Meg.  When MultiFinder
launches your App, it will give it 2 Meg, leaving 4 Meg free for other
things.

If your suggest size is more than the amount of memory that is free,
then Finder will tell the use that there is not enough memory to open
your App, and ask if you want it opened in the available memory. 
An example of this would be 2 Meg free and the App has a suggested
size of 4.

The minimum size is the minimum amount of memory that your App will
run in.  Often, if programs are run in less than this amount, they
will crash (try running most Apps in 50K!).


The run of thumb I use is that the minimum size should allow the App
to run, but performance might not be very good (because of segment
swapping and such), and the suggested size should give enough memory
for the App to run well with a resonable amount of data - though not
hog all the memory in a machine if that can avoided.  

You should also read what Apple has to say about SIZE resources in the
tech notes.

-- michael

P.S.  (WARNING: self serving advertisement to follow) To figure out
how much memory is really appropriate for min and suggested sizes
is often a trial and error process.  AppSizer can help with this by
making it very easy to keep rerunning your App in smaller and smaller
sizes until bad things start to happen. 


--  Michael Peirce         --   outpost!peirce@claris.com
--  Peirce Software        --   Suite 301, 719 Hibiscus Place
--  Macintosh Programming  --   San Jose, California 95117
--           & Consulting  --   (408) 244-6554, AppleLink: PEIRCE

dorner@pequod.cso.uiuc.edu (Steve Dorner) (03/14/91)

In article <0B010004.51uxla@outpost.UUCP> peirce@outpost.UUCP writes:
>You should also read what Apple has to say about SIZE resources in the
>tech notes.

Apple has said some pretty wild things about the SIZE resource.

  The minimum size should be chosen such that the application would
  never "system error" if required to run in this amount of memory.
  Some application writers may choose to specify as minimum the amount
  of memory required merely to bring up an "I don't have enough memory"
  dialog.  Others may choose to use the minimum useful amount of memory
  here.
  
  The preferred size should be chosen to allow the application to perform
  90% of its function without problems.  On the other hand, it shouldn't
  be too greedy.  Remember that in the MultiFinder environment that
  applications are sharing the machine with one another, and an application
  with a 1024K preferred size is likely to be viewed with contempt
  by users and other application writers alike.

Taken from "Are You Multifinder Friendly?", written August, 1987 (but
purchased much later than that).  My, how times (but not necessarily Apple
documentation) have changed.

I'm not even sure this was good advice when it was written.  Enough memory
to put up a "not enough memory" alert?  90% functionality?
--
Steve Dorner, U of Illinois Computing Services Office
Internet: s-dorner@uiuc.edu  UUCP: uunet!uiucuxc!uiuc.edu!s-dorner