The situation worsened with the advent of
Switcher, which was a way for a Mac with 512 KB or more of memory to run multiple applications at once. This was a necessary step forward for users, who found the one-app-at-a-time approach very limiting. Because Apple was now committed to its memory management model, as well as compatibility with existing applications, it was forced to adopt a scheme where each application was allocated its own heap from the available RAM. The amount of actual RAM allocated to each heap was set by a value coded into the metadata of each application, set by the programmer. Sometimes this value wasn't enough for particular kinds of work, so the value setting had to be exposed to the user to allow them to tweak the heap size to suit their own requirements. While popular among "
power users", this exposure of a technical implementation detail was against the grain of the Mac user philosophy. Apart from exposing users to esoteric technicalities, it was inefficient, since an application would be made to grab all of its allotted RAM, even if it left most of it subsequently unused. Another application might be memory starved, but would be unable to utilize the free memory "owned" by another application.
Virtual memory schemes, which made more memory available by paging unused portions of memory to disk, were made available by third-party utilities like Connectix Virtual, and then by Apple in
System 7. This increased Macintosh memory capacity at a performance cost, but did not add
protected memory or prevent the memory manager's heap compaction that would invalidate some pointers. ==32-bit clean== Originally the
Macintosh had 128 KB of RAM, with a true limit of 4 MB, despite being soldered. This limit was first reached with the
Macintosh Plus and its user upgradable memory. These first few Macintosh computers use the
68000 CPU, a 32-bit processor which has only 24 physical address lines. The 24 address lines allow the processor to address up to 16 MB of memory (224 bytes), seen as sufficient at the time. The structure of the memory map divided this address space into maximums of 4 MB of RAM, 4 MB of
ROM and the remaining 8 MB of addresses split between the
SCC, IWM and VIA chips. This was fixed by changing the memory map with the
Macintosh II, allowing up to 8 MB of RAM, by shrinking ROM and I/O addresses to 1 MB each and allocating the remaining 6 MB addresses to the
NuBus slots.
Connectix products MAXIMA, RAM Doubler, and Virtual allowed accessing and reallocating the 6 MB addresses for the NuBus cards for a total of 14 MB, minus 1 MB per slot occupied. Because memory was a scarce resource, the authors of Classic Mac OS decided to take advantage of the unused byte in each address. The original Memory Manager (up until the advent of System 7) placed flags in the high 8 bits of each 32-bit
pointer and
handle. Each address contained flags such as "locked", "purgeable", or "resource", which were stored in the master pointer table. When used as an actual address, these flags were masked off and ignored by the CPU. ==Object orientation==