This page is a wiki. Please login or create an account to begin editing.


20 posts / 0 new
Last post
fluent's picture
Offline
Joined: 2021 Jan 7
Disk Cache and RAM Disk?

hey guys. so i am reading Mac OS 9 for dummies and found out about these 2 things. Should I use them? disk cache is set at 8120k but it can go much higher as i have 1.5gb of RAM. and RAM disk can be quite large and house my system folder as i heard that gets you a big speed increase. are these 2 things worth checking into? thanks!

Comments

Bolkonskij's picture
Offline
Joined: 2009 Aug 3

I used to use RAM Disks a lot back in the day (coming from the Amiga Smile ) but I can't see why I would want to use them today.

RAM Disks on the Mac were useful if you were e.g. an owner of a PowerBook and, in order to conserve energy, put everything onto your RAM Disk while working so that your hard drive could spin down. The downside was that once your system froze you lost all unsaved work because well, it was only in the RAM.

Years back LowEndMac.com ran some RAM Disk benchmarking, it can be found here. Obviously Dan Knight was very fond of ramBunctious.

m68k's picture
Offline
Joined: 2016 Dec 30

Oh yeah - RAM disks on Amiga, those were the days. Back then I thought I was better equipped than James Bond, because I could store half a floppy in RAM - and Mr. Bond couldn't. Laughing out loud

lilliputian's picture
Offline
Joined: 2010 Jul 29

Disk Cache (formally RAM Cache) is a small amount of RAM that the system uses as a cache for repeated operations. It was apparently not especially useful at first (System 6 or earlier, early 7) but from what I've briefly read it became more useful as time went on.

You can, in principle, set it as high as you want (minus the absolute required RAM needed for the OS to operate), but there are probably diminishing returns for very high values, and in fact it would begin to bog down your system as you set the cache so high that the amount of free RAM becomes low enough that the system has to perform a bunch of swapping within RAM in order to accommodate the applications you're using. (Note that if you run a benchmark test using Norton Utilities' System Info, it will actually ask you to set the Disk Cache lower, to 128k I believe.)

By OS 9, the system figures out an amount that's most useful to it without using too much, but you can, as mentioned, set it higher if you think it might help (experiment and see!).

RAM Disks, by the age of the Hard Disk Drive, were not especially useful anymore, though they have their uses still. For instance, in System 7 and later, you can create a temporary startup disk so that you can run repairs on your main drive without having to fiddle with a physical disk or CD (and it will be quite fast at that, being stored in RAM).

As Bolkonskij mentions, they were much more useful in the early days though. Particularly in System 6 and earlier, when you might have only had one floppy drive while using a Mac (and no hard drive!), using something like RamDisk+ would have been a lifesaver, freeing up your floppy drive for other disks, and reducing the need for disk swaps. If you had a Mac Plus with 4MB of RAM, or an SE or Mac II with even more, a lot of that could be safely assigned to a RAM Disk, especially with MultiFinder turned off (though it would not be preserved on restart at this point in time).

SkyCapt's picture
Offline
Joined: 2017 Jan 11

I tested a RAM-disk in Tiger recently and found the speed of it was little different than a SATA-I SSD (of which 1TB costs now only $100). It should have been insanely faster along the evolution of things. I conclude nowadays the speed advantage RAM-disk once had has been devastated by the adoption of "Protective Memory".

Anyway, the Tiger Finder has its own personal RAM-disk built in and operating behind the scenes, under the hood. Example, in Terminal, "md5 {name}" of a 1.6 GB image lonewolf file took 22 seconds. Immediately repeating the task, takes 19 seconds, noticebly faster. The 1.6 GB file fits within my 2.0 GB RAM. Same test performed on a 2.2 GB file which does not fit inside RAM: not faster when repeated. Looks like they were right afterall in saying "more RAM=faster Mac".

fluent's picture
Offline
Joined: 2021 Jan 7

if i were to say, use Rambunctious, and make a 250mb ram disk, what would i then put in the 'startup items' folder? the system folder? would the system still load if the system folder is in the permanent ram disk?

lilliputian's picture
Offline
Joined: 2010 Jul 29

I'm not specifically familiar with ramBunctious, but typically you can treat a RAM disk like any other disk/volume, except that it lives in RAM. If you wanted to create a startup RAM disk, you would simply copy a valid System Folder to the RAM disk (you might need to open the folder once copied in order to "bless" it), then use the Startup Disk control panel to select the RAM disk as the startup volume, and restart. (You shouldn't need to mess with the "Startup Items" folder within the System Folder, as this is just for launching files/applications at boot.)

fluent's picture
Offline
Joined: 2021 Jan 7

so, copy the system folder there? or alias it, or what? and for startup items i mean in the ram disk there is a folder called that. do i put anything in there.

lilliputian's picture
Offline
Joined: 2010 Jul 29

You would copy the System Folder, not alias it. It's just copying to RAM, so don't worry about using actual disk space for this.

As for that lone Startup Items folder, perhaps it's something to do with ramBunctious? There is not normally such a folder at the root level of a volume, so I can't say why it's there. A RAM disk created using the Memory control panel (as opposed to 3rd-party software) would simply be blank/empty.

adespoton's picture
Offline
Joined: 2015 Feb 15

The Startup Items folder, IIRC, was somewhere you dump aliases for things you want to load after the RAM disk mounts.

As for RAM Disk uses... back in the day we used to have a boot floppy we used for our Mac Plus networks... at the start of day, you turned on all the Pluses, then one by one inserted the floppy, waited for it to boot and then reboot to the RAM disk and eject the floppy, then move on to the next and repeat. Then the floppy stayed at the IT services station for those jokers who unplugged the Pluses to leave them at the flashing ?.

This was useful because it meant anyone could come along, log in with their network ID, and then have a free floppy drive to load/save documents and personal applications.

lilliputian's picture
Offline
Joined: 2010 Jul 29

Clever!

m68k's picture
Offline
Joined: 2016 Dec 30

Running on B-II for Android I can assure you folks, that a RAM disk still makes a lot of sense, to spare my SSD card the write cycles caused by unpacking archive after archive - as I just can't stop myself from unstalling stuff (not sure why that is). Shock

cbone's picture
Offline
Joined: 2011 Sep 17

I second m68k's sentiment on saving a SSD drive's write cycles, especially if you have plenty of RAM to spare!

Back in the day, I used to use a bootable RAM disk to house a tiny OS, sometimes even substituting the finder for the specific program I wanted to run in RAM and possibly the documents I would run as well. With more RAM, I'd keep the finder and even add additional programs. The key is to save a copy of at least your documents (usually I would just copy the entire RAM disk to my hard drive or removable zip or orb disks) before shutting down so you don't lose your work (unless all I was doing was some quick web surfing, lol) Wink

fluent's picture
Offline
Joined: 2021 Jan 7

so how would the ram spare my ssd? my OS is installed on an ssd so that means any action taken on that desktop, etc., happens on the ssd, correct? shoot, i must have unstuffed 300 files already! hope i'm not ruining things. should i go ahead and make a RAMdisk?

adespoton's picture
Offline
Joined: 2015 Feb 15

SSD has a certain number of write cycles per bit before the bit will fail. Using a RAM disk on data that has many write cycles as part of the activity (like a live database, cache files, etc.) means that all those writes happen to RAM, and the results only get written back to SSD once at the end of the session.

That said, in practice, SSDs have more bits than they report, and a controller that distributes the "wear" over the entire set, and isolates bad bits as they fail. The result is that a modern SSD will generally last way longer than a spinning platter, even with the limited write lifespan of each bit.

I've had SSD and nVME drives going now for 6 years with no noticeable degredation, despite heavy write loads on some -- and I've had SD cards using the same technology that have been happily storing and overwriting photos and video for 18 years with no failures.

So if you have RAM to spare, it won't hurt, and may even be faster, but it's not as big a deal in practice as it is in theory. Just be aware that just like HDDs and optical media, SSDs don't last forever.

lilliputian's picture
Offline
Joined: 2010 Jul 29

SSDs, especially in their earliest incarnation, can degrade (lose speed) over time with too many write operations. I honestly don't think it's as much of a problem as it used to be, and 300 operations is probably not going to be a big deal in isolation. But if you're concerned you can use a RAM disk as a temporary storage place for archives and such, and then only copy the expanded contents when they're ready, thereby limiting the number of writes to the main drive.

RAM disks would also make good "scratch" disks for programs that use such things, such as video or graphics programs.

EDIT: Does this also apply to SD cards, CompactFlash, or USB flash drives in general? Or is this unique to modern SSDs?

cbone's picture
Offline
Joined: 2011 Sep 17

All of the above, lilliputian.

RAM doesn't store anything after you cut the power, but any flash-based media will wear after a finite number of re-writes. if you use any flash media for permanent storage, you're good to go, so it's all about the writes.

m68k's picture
Offline
Joined: 2016 Dec 30

Well, maybe I should have been more specific in calling it an SDXC card, rather than a full fledged SSD. SDXC cards have a definite tendency to degrade quickly and as more you write on them as shorter their lifespan gets. Ah and yes I once did manage to "shred" a Samsung tablet's internal SSD storage, by trying to install AmigaOS on it a few hundred times over. So those onboard SSD chips, too, won't last forever.

cbone's picture
Offline
Joined: 2011 Sep 17

Wow, that SSD shred sounds like a costly endeavor, m68k,yikes! Shock

m68k's picture
Offline
Joined: 2016 Dec 30

Well, back then I could afford it. Bought two replacement tablets and moved the Amiga stuff to the SDXC. Nowadays … I got to pinch every dime and squeeze each byte for what its worth. Shock