Managing Memory

The main part of a computer’s memory, known as random access memory (RAM), retains data independently of the disk drive. It acts as a temporary store for the system, documents and applications. If your computer crashes or there’s a power failure its contents are lost.

  The Workings of Memory

If you select About this Computer under the Apple menu in the Finder you’ll see how much RAM is in your machine. If the figure for Total Memory is bigger than Built-in Memory or a figure isn’t given for Total Memory you must be using virtual memory (VM) or RAM Doubler.

The amount of RAM required depends on the demands of your system and on the size and number of applications in use. The following table gives guidelines for the minimum and maximum RAM needed for older versions of the Classic Mac OS, as well as the RAM used by the system itself:-

Mac OSMinimumWorkableSystem RAM
61 MB2 MB500 K
72 MB4 MB1.5 MB
7.54 MB8 MB2 MB

A modest application uses between 500 K and 2 MB of memory, although some multimedia applications can quickly use all the memory in your machine. The memory required by an open document is dependent on its size: the following table gives a rough guide to how many kilobytes are needed to represent text, assuming an average of 6 letters per word:-

WordsMemory (K) WordsMemory (K)
1701 500030
5003 850050
10006 1000060
170010 1250075
250015 17000100

In practice, a text document often use more memory, depending on the file type. However, a graphics file can absorb vast amounts of memory. For example, a black and white image covering a standard A4 page uses around 1 MB. This rises to 8 MB for 8-bit colour or to 23 MB for 24-bit colour. And these figures can be doubled again if your graphics application has an Undo feature.

Allocating Memory to an Application

The memory allocated to an application is set within the application itself. To change this allocation you must quit the application, select its icon in the Finder and choose File ➡ Get Info ➡ Memory, which should reveal a window similar to this:-

The Suggested Size is the amount of memory that you’re advised to use by the maker of the application and can’t be changed from within the window. When the application is next launched it tries to use the Preferred Size as its memory allocation, but if this isn’t possible, it uses any available memory in the range between Minimum Size and Preferred Size.

If you’re using Mac OS 8.6 or higher you may need to set both Minimum Size and Preferred Size to a higher value than that shown under Suggested Size, especially if Virtual Memory isn’t enabled in the Memory control panel (see below). Even with earlier systems, many applications are happier with a bigger slice of memory, especially if data is stored in the application’s own memory area.

Memory Heaps

The Mac’s memory comes in two heaps. The system heap starts at low addresses and automatically works up whilst the application heap starts at the top and works down. All versions of the system later than Mac OS 7.x are designed to prevent these two heaps from colliding.

The first application that you open is put at the top of the application heap and subsequent programs fill the space beneath. The amount of space available is shown in the About this Computer window.

Memory Fragmentation

Each application in a Mac needs an unbroken or contiguous block of memory. If you launch and quit several programs, the memory space is broken up or fragmented. It’s then impossible to launch further applications, even though there appears to be enough memory.

Memory Problems

When things you wrong you’ll see messages or suffer from odd behaviour, such as the following:-

Message: Not enough memory

Message: The application ... has unexpectedly Quit (unknown error)

Message: Hanging watch, system stopping and starting, colours going grey, font problems

Messages: Out of memory, Address Error, Bus Error, bombs (25,28,33 or 35), font problems

Minimising Memory Failures

To conserve memory and to avoid memory fragmentation and other problems you should:-

As for applications, you should:-

  The Memory Control Panel

The Memory control panel, illustrated below, determines how the system uses its RAM.

  Disk Cache

A disk cache is a portion of RAM that’s set aside as a software buffer, containing data received from your hard disk drive. It holds recently-used information, thereby speeding up the machine and minimising wear on the drive. The appropriate part of the Memory control panel is shown below:-

You can set the Disk Cache value in 32 K steps, which is convenient since you’re advised to use at least 32 K for every MB of machine RAM, corresponding to 256 K for an old machine with an 8 MB RAM or to around 8160 K for a modern PowerPC-based machine with 192 MB of RAM.

  Virtual Memory (VM)

Virtual memory increases the effective memory of your machine by utilising spare hard disk space. It’s normally enabled in Mac OS 7.6 or higher, although it’s very slow on older 680x0-based machines. On PowerPC-based models, VM speeds up application launching and should normally be enabled, unless it upsets any particular software. The appropriate part of the Memory panel is shown below:-

The minimum total memory provided by VM is 1 MB more than the physical RAM. Although it can be increased to as much as four times the RAM, it’s best kept to less than 1.5 times the RAM. VM works by temporarily swapping-out data that’s not wanted in RAM at the present time onto hard disk. The process of swapping-in moves the data back into RAM again.

You shouldn’t use virtual memory when:-

With older computers or earlier systems you may prefer to use RAM Doubler (Connectix) instead of VM. However, you mustn’t give each application more memory than the size of physical RAM minus the machine’s system requirements. The version of RAM Doubler that you employ must suit your particular system. In addition, it can’t be used on machines that have a second PowerPC processor.

  32-bit Addressing

Older versions of the Memory panel let you turn 32-bit addressing on or off. This should be enabled if you need more than 8 MB of RAM and if you have 32-bit clean applications.

Modern systems, from Mac OS 7.6 upwards, employ 32-bit addressing, which is theoretically capable of using 4 GB of memory. In practice, the processor has to address other devices, restricting RAM to 1 GB. Older Macs, with 68000 or 68020 processors, use 24-bit addressing, providing a range of 16 MB. This permits only 8 MB of RAM to be used, even when more physical RAM has been fitted.

  RAM Disk

A RAM disk is a virtual disk, kept in memory, that acts as a disk drive. The appropriate part of the Memory panel is shown below:-

Setting up and Using a RAM Disk

  1. Work out how much space you’ll need
  2. Choose Off under Virtual Memory in the Memory control panel
  3. Select On under RAM Disk and move the slider to give the required space
  4. Check that Save on Shut Down is chosen
  5. Select the RAM disk in the Startup Disk control panel
  6. Select Special ➡ Restart in the Finder
  7. Drag your hard disk to the Trash and select OK in the dialogue
  8. Work with your computer as normal

Only a power loss or crash should cause any loss of data

Returning to Normal Operation

  1. Open the Startup Disk alias on the RAM disk and select your normal drive
  2. Select Special ➡ Restart in the Finder
  3. Select the RAM disk and choose Special ➡ Erase Disk
  4. Choose Off under RAM Disk in the Memory control panel
  5. Select Special ➡ Restart in the Finder

  Parameter RAM

The Parameter RAM (PRAM) stores 256-bytes of data between startups, and is separate to the normal RAM. It also contains a real-time clock circuit used by the Mac OS, the output of which appears in the menubar clock. A PowerPC-based PCI machine also has a non-volatile RAM (NVRAM).

64 bytes of data are set aside to store parameters for the following control panels, several of which aren’t used in modern versions of the Classic Mac OS:-

AppleTalk, Colour, Date & Time, Desktop Patterns, General Controls, Keyboard, Map, Memory, Mouse, Monitors, Monitors & Sound, Network, Screen, Sound, Startup Disk, Trackpad

The PRAM also retains configurations for the Modem port and Printer port, together with your choice of port for a printer. It also contains settings for the Power Manager, which controls the behaviour of the processor and screen. The remaining 192 bytes of PRAM are reserved for manufacture date and other factory settings, although some are used by other software.

  Zapping the PRAM

The PRAM can be reset or zapped by pressing -Option-P-R during startup. On some machines you may need to hold down the keys until the second startup message appears. This process resets all parameters except the clock. You should only need to do this if:-

Some experts claim that you should zap the PRAM at least three times, since all the data isn’t cleared in one go. Better still, use a free utility called TechTool Lite (Micromat Inc).

The following zapping method is recommended by Apple for older PCI-based machines:-

  1. Select Special ➡ Shut Down in the Finder.
  2. Ensure that the Caps Lock key isn’t engaged.
  3. Press the Power key, which is often identified by a icon.
  4. Press -Option-P-R after the first startup sound.
  5. After the second startup sound hold down Shift until Extensions Disabled appears in Welcome to Mac OS. If it doesn’t appear, select Restart and hold down Shift until it does.
  6. Open the Preferences folder and drag Display Preferences to the Trash.
  7. Select Special ➡ Restart in the Finder.

Having zapped the PRAM some control panel settings will change, although the actual effect varies with hardware and your version of the Mac OS. Typical effects on control panels include:-

You can reset these panels to their original settings by hand or by using a file created with TechTool.

©Ray White 2004.