• Hello, Guest! Welcome back, and be sure to check out this post for more info about the recent service interruption and migration.

RAM compression on OS X 10.4?

Byrd

Well-known member
Modern OSes (including OS X and Windows) all do memory "compression" on the fly, it was really only Mac OS 7.x that benefited from third party RAM utilities. By the time Mac OS 8.5+ came out it was not required as Apple's implementation of VM did the same thing (didn't stop them releasing third party utilities though).
 

avadondragon

Well-known member
RAM compression is a fairly new built-in OS feature. Apple didn't introduce it in OS X until Mavericks. See here: Memory compression brings RAM Doubler to OS X Mavericks. Memory compression wasn't a feature of Windows even in the earliest builds of Windows 10. It came about in Windows 10 1507. And it wasn't available in the Linux kernel until version 3.14. It definitely didn't exist in any version of classic Mac OS off the shelf.
 

kitsunesoba

Well-known member
I would be very surprised if such a thing exists, simply by virtue of how differently OS X is built compared to OS 9. It might be possible to implement memory compression in an OS X kernel extension, but I don't think so. You'd probably have to build a custom Darwin kernel to get that functionality.
 

MacKilRoy

Well-known member
RAM Doubler took a portion of RAM and turned it into a RAM Disk, then applied a low level drive compression to the RAM Disk, and then deployed its own virtual memory system to that. In essence compressing memory.

Theoretically, the same could work on OSX if an enterprising coder tried hard enough.
 

avadondragon

Well-known member
Creating a RAM disk and compressing it wouldn't be difficult. The tricky part is doing it early enough in the boot process to relocate the swap file there. But then it has to have a secondary pagefile on disk for when the RAM disk overflows. This could be interesting to research...

Looks like there's a daemon called dynamic_pager that creates a 'pool' of swap files that it expands and contracts as necessary. It might not be that difficult to implement.

edit: I didn't realize HFS+ Compression wasn't around before Snow Leopard so that makes things much more difficult.
 
Last edited:

Cory5412

Daring Pioneer of the Future
Staff member
I'm not aware of anything that exists on this front. I think it would be very difficult to build, and may be impossible to integrate into the OS.

The mechanism by which Classic Mac OS integrated this kind of thing is that RAMdoubler et al were entire replacement memory managers. It's almost certainly not possible to build something like that for OS X.

For better or worse, the fact that most 10.4-era PPC Macs in particular have relatively low RAM ceilings compared to 10.4's ability to eat RAM if you run a lot of software is Just Part Of The Charm Of The Era.

I don't remember if it was this thread or another but I was thinking the other day about how the late PPC and early Intel era is one of the few times it was possible, reasonable, and desirable to max out the RAM on a system up fairly early on in its life.

If memory compression had been possible, especially on PPC Macs with lower RAM ceilings but a potential couple more years of service life in them, I think it would have been built. This era had lots of new Mac users and 2006 was also the year laptops crossed over as the most popular type of computer in most contexts, so there was a strong presumptive market for software that could boost memory efficiency.

That said, based on my notes below about what RAM Doubler was actually doing, at least if TidBITS reported it correctly -- Mac OS X didn't have the specific shortcomings of the Classic Mac OS that made what RAMdoubler did necessary. In OS X, each application takes what it's using at the moment and no more. (The biggest exception to this is if Apple was doing disk caching in the RAM which would have been with a random available amount of RAM, Windows Vista did this a little too aggressive, Windows 10/11 still do but a bit less so and more for writes than prefetching things since random reads on SSDs have partly obviated the need for that.)

RAM Doubler took a portion of RAM and turned it into a RAM Disk, then applied a low level drive compression to the RAM Disk, and then deployed its own virtual memory system to that. In essence compressing memory.

From this, it looks like it's more about compacting the existing RAM usage. It puts other applications into the area apps have allocated but aren't currently using. For example, in that blank area at the end of "Dreamweaver MX" in this screen shot.
1644467888669.png

That can, of course, have changed over the years, but using a RAMdisk as the swap file destination seems like it would be an unnecessary limitation and an extra step in the process. It's likely that the final destination if things do actually use more RAM than you have is to the disk.
 

MacKilRoy

Well-known member
I'm not aware of anything that exists on this front. I think it would be very difficult to build, and may be impossible to integrate into the OS.

The mechanism by which Classic Mac OS integrated this kind of thing is that RAMdoubler et al were entire replacement memory managers. It's almost certainly not possible to build something like that for OS X.

For better or worse, the fact that most 10.4-era PPC Macs in particular have relatively low RAM ceilings compared to 10.4's ability to eat RAM if you run a lot of software is Just Part Of The Charm Of The Era.

I don't remember if it was this thread or another but I was thinking the other day about how the late PPC and early Intel era is one of the few times it was possible, reasonable, and desirable to max out the RAM on a system up fairly early on in its life.

If memory compression had been possible, especially on PPC Macs with lower RAM ceilings but a potential couple more years of service life in them, I think it would have been built. This era had lots of new Mac users and 2006 was also the year laptops crossed over as the most popular type of computer in most contexts, so there was a strong presumptive market for software that could boost memory efficiency.

That said, based on my notes below about what RAM Doubler was actually doing, at least if TidBITS reported it correctly -- Mac OS X didn't have the specific shortcomings of the Classic Mac OS that made what RAMdoubler did necessary. In OS X, each application takes what it's using at the moment and no more. (The biggest exception to this is if Apple was doing disk caching in the RAM which would have been with a random available amount of RAM, Windows Vista did this a little too aggressive, Windows 10/11 still do but a bit less so and more for writes than prefetching things since random reads on SSDs have partly obviated the need for that.)



From this, it looks like it's more about compacting the existing RAM usage. It puts other applications into the area apps have allocated but aren't currently using. For example, in that blank area at the end of "Dreamweaver MX" in this screen shot.
View attachment 38325

That can, of course, have changed over the years, but using a RAMdisk as the swap file destination seems like it would be an unnecessary limitation and an extra step in the process. It's likely that the final destination if things do actually use more RAM than you have is to the disk.

RAM Doubler divided your RAM into 4. The first quarter was real RAM, the remainder was turned into a RAM disk that was invisible to the system. The remaining 3/4 of RAM disk had “disk” compression applied to it, and then Connectix’s own virtual memory was deployed on the RAM disk. The 3/4 compression along wiresulted in a total available memory of around 2x installed RAM.

This is the way it functioned and worked. It was quite simple and brilliant. When RAM Doubled 2 was released, the compression and other memory management features had improved to allow it 3x RAM availability.

If you research the topic, people were doing tricks like these on 8MB 386 machines to allow them to use 12MB applications.
 
Top