Jump Development Banner

RC Icon

RAM Charger 8 For Macintosh
Home | Search | Support | Contact | Download | Order


Why does OS 8.1 require RAM Charger 8.1?


(Tech0003A -- 02/17/98)

A specific list of changes in Mac OS 8.1 is given in Apple's document "tn1121.html". As far as we have been able to determine, OS 8.1 is almost a transparent upgrade as far as RAM Charger is concerned - having only one visible symptom which occurs under PowerPC with Virtual Memory (VM) enabled. The applicable change, noted in "tn1121.html", is the new ReleaseMemoryData call provided for Virtual Memory.

The Details

RAM Charger needs to access the information in an application's partition at the last possible moment during "quit" to clean up any expanded memory. We must wait as long as possible so that we may leave the memory available for the application's use.

Prior to OS 8.1 the "starting partition" memory reserved for each application was invalidated during the application "quit" (_ExitToShell) by a call to either "_DisposeHandle" or "_BlockMove". In all cases, an application's partition is a Locked-Relocatable-Block reserved in the ProcessZone. Previously, the data within the block would remain valid up until the time the system disposed the Handle, or used BlockMove to copy data into the block.

In OS 8.1 with PowerPC and VM enabled, a new call to the "VM" trap "_MemoryDispatch" invalidates the memory within the application's partition before "_DisposeHandle" is called. In specific, the new routine is given the abstract name ReleaseMemoryData ("_MemoryDispatch" with selector D0==$000C). Apple writes: "If the released range is subsequently accessed, the values in memory will be unpredictable.".

Our Solution In RAM Charger 8.1

We had to enhance RAM Charger to cleanup up in the case of the new ReleaseMemoryData. If we waited until "_DisposeHandle" in the new OS 8.1 with PowerPC and VM enabled, the "partition data" might be invalid and improper cleanup could result in an unstable system.


The new ReleaseMemoryData call releases the tie to backing storage for a range of virtual memory. This is the reverse of FileMapping, and as valuable since it will speed up the system by avoiding fruitless paging.

During application "quit", the new ReleaseMemoryData call is applied to range of memory, resulting in access to that memory not restoring paged out data. Instead, any random available memory may be assigned to the address range, without having to restore that data previously written to the address range. This yields the memory unpredictable, or "trashed".

In the case where we have seen this used, it is legitimate for this ReleaseMemoryData to basically trash memory. The call is made just before "DisposeHandle" on a block of memory that is a defunct application partition.

The good part is that this new ReleaseMemoryData optimization can speed up operation of your machine subsequent to quitting an application since any memory within the application's partition does not need to be restored after the application quits (when the memory is re-used). If the call were not made, then the system would have to read back in any "defunct" data that was paged out when the block data would next be used.

The bad part is that any code that depends on data remaining constant in a block of memory must beware of this new ReleaseMemoryData. However, we suspect Apple will (does) use it with caution, and very little code will have dependency.

You may download the version 8.1 software here. This is a free update to RAM Charger 8 owners.


Home | Search | Support | Contact | Download | Order
Translate to: Français | Deutsch | Italiano | Português | Español

Please direct corrections and comment to RAMCharger (at) RAMCharger.com

Copyright © 1995-98 Jump Development Group, Inc. All rights reserved. Jump, OptiMem, RAM Charger, and More About This Mac are trademarks of Jump Development Group, Inc. Apple and Macintosh are registered trademarks of Apple Computer, Inc. All other trademarks are the property of their respective holders.