Macintosh: Maximum Clipboard Size

The Clipboard may be written to disk whenever the application requires the
memory space, therefore the maximum size of the Clipboard is limited by the
available disk space on the startup disk.

A more internal limit to the Clipboard occurs with the Scrap Manager, a set of
routines and data types that let Macintosh applications support cutting and
pasting using a specially allocated portion of RAM called the desk scrap or
scrap, which is not to be confused with the Scrapbook desk accessory.

The desk scrap is initially located in a portion of RAM called the application
heap. When starting up an application, the Segment Loader temporarily copies
the scrap out of this heap into a portion of RAM called the stack. There is a
brief moment when the scrap and a copy of the scrap both exsist, the scrap in
the heap and the copy in the stack; for this reason, the desk scrap cannot be
bigger than half the amount of memory allocated to heap and stack.

The amount of memory allocated to heap and stack varies with each application.
However, as RAM increases from 128K to 512K to 1M bytes, larger and larger

amounts of RAM can be allocated to heap and stack. In a Macintosh Plus with
1Mbyte of RAM, this allocation could be as big as 800K, giving a possible
Clipboard size of 400K, depending, of course, on the application.

After the copy of the scrap is in the stack, the Segment Loader reinitializes
the heap, and copies the scrap back from the stack into the heap, where the
Scrap Manager can use it for cutting and pasting. A handle to the scrap is
stored in low memory.

An application can keep the scrap on disk, which puts a limit of available
disk space on top of the limit of one-half the RAM allocated to heap and
stack. To use this scrap disk file, two applications would have to have a
consistent amount of RAM allocated to their heaps and stacks. The scrap of the
first application could be written to disk, left on disk with warnings against
dismounting the disk with the scrap file, and the second application could
then read the scrap file from disk.

Notes:
 -- This description idealizes the application. Keep in mind that real

    applications often will not handle the clipboard this way.
 -- Machines with 64K ROMs are limited to a maximum picture size
    of 32767 bytes.
Published Date: Feb 19, 2012