RAM Disk Creator

CptSky

macrumors regular
Original poster
Feb 1, 2013
140
13
Just releasing a simple tool to create RAM disks. I used to use one on my Intel Macs, but it wasn't build for PowerPC. I did one with Qt, so it's universal. The UI is just a wrapper around a simple command.

MediaFire:
RAM Disk Creator 1.0.0 (PowerPC)
RAM Disk Creator 1.0.0 (Universal)
RAM Disk Creator 1.0.0 (Intel64)

Mirror
RAM Disk Creator 1.0.0 (PowerPC) [10.3 - 10.5]
RAM Disk Creator 1.0.0 (Universal) [10.5 - 10.8]
RAM Disk Creator 1.0.0 (Intel64) [10.6+]


N.B. The universal build is linked against Qt 4.8.4 and will work on any system between Leopard and Mountain Lion (10.5 - 10.8, all architectures). The Intel64 build is linked against Qt 5.2.0 and will work on any system higher or equal to Snow Leopard (10.6 - 10.9), Qt4 being incompatible with Mavericks.
N.B. The universal build will kind of works on Mavericks.

Nothing fancy, feel free to share.
 
Last edited:

AmestrisXServe

macrumors 6502
Feb 6, 2014
263
1
Just releasing a simple tool to create RAM disks. I used to use one on my Intel Macs, but it wasn't build for PowerPC. I did one with Qt, so it's universal. The UI is just a wrapper around a simple command.

RAM Disk Creator 1.0.0 (Universal)
RAM Disk Creator 1.0.0 (Intel64)

N.B. The universal build is linked against Qt 4.8.4 and will work on any system between Leopard and Mountain Lion (10.5 - 10.8, all architectures). The Intel64 build is linked against Qt 5.2.0 and will work on any system higher or equal to Snow Leopard (10.6 - 10.9), Qt4 being incompatible with Mavericks.
N.B. The universal build will kind of works on Mavericks.

Nothing fancy, feel free to share.
Is there any reason this won't work on Panther or Tiger?
if not, what is the reason?
Is the RamDisk volatile, or non-volatile through a restart (not power off)?
Will you be providing sources?

Mirrored
(Direct Download, no MediaFire garbage):
http://timelord.insomnia247.nl/RamDisk_Creator_1.0.0_Intel64.dmg
http://timelord.insomnia247.nl/RamDisk_Creator_1.0.0_Universal.dmg

I've been wondering why there were few RamDisk utilities out there, given the huge amounts of RAM available on most systems. If it can survive a restart, it could be quite useful, especially if it can be targeted as a startup volume.
 

CptSky

macrumors regular
Original poster
Feb 1, 2013
140
13
Is there any reason this won't work on Panther or Tiger?
if not, what is the reason?
Is the RamDisk volatile, or non-volatile through a restart (not power off)?
Will you be providing sources?

Mirrored
(Direct Download, no MediaFire garbage):
http://timelord.insomnia247.nl/RamDisk_Creator_1.0.0_Intel64.dmg
http://timelord.insomnia247.nl/RamDisk_Creator_1.0.0_Universal.dmg

I've been wondering why there were few RamDisk utilities out there, given the huge amounts of RAM available on most systems. If it can survive a restart, it could be quite useful, especially if it can be targeted as a startup volume.
1. If the command is available on both versions, it should be compatible. The problem is that I don't have access to any hardware supporting Panther (nor the installation CD), and I don't own Tiger so my G5 only have Leopard. I can't test.

The second part for the compatibility is Qt.
- Qt 4.8 supports Tiger to Snow Leopard if Qt is built using Carbon (32-bit only).
- I built Qt 4.8 using Cocoa to have support of Leopard to Mountain Lion (32/64).
- Qt 5 dropped Carbon and PowerPC, needing at least Snow Leopard.
- Panther would require Qt 4.5 which I have no idea if it will be compatible.

A Tiger version could be easily done (just need to build Qt with Carbon), but untested. A Panther version is more complicated, but probably could be done. If people want it, I'll check to do them.

2. Computer DRAM is volatile. So, the downside of RAM Disk are that you'll loose everything if you eject the disk or shutdown the computer.

3. Well, I've not though of if I will release or not the source. After all, it's just a Qt UI calling « diskutil erasevolume HFS+ '%s' `hdiutil attach -nomount ram://%llu` » and with a worker thread getting the actual free memory (Mach API). But if people want it, I can release the source under a BSD license.
 

eyoungren

macrumors Core
Aug 31, 2011
21,267
13,116
ten-zero-eleven-zero-zero by zero-two
I'm curious. Is there any difference between this tool and the old System Preference pane Esperance DV?

I found Esperance when I was on Panther and its worked in Panther, Tiger and Leopard.

Since the link above is discontinued, here's my Dropbox link if you want to check it out.

EDIT: LOL! Just tried Esperance on the Mac Pro at work running Mavericks 10.9.1. It works. I have a RAM disk on my desktop with this Mac. Very, very funny to me how this PowerPC system pref works on the latest version of Intel OS X!
 
Last edited:

AmestrisXServe

macrumors 6502
Feb 6, 2014
263
1
2. Computer DRAM is volatile. So, the downside of RAM Disk are that you'll loose everything if you eject the disk or shutdown the computer.
Naturally, if the system is powered down, the contents of NVRAM are flushed. I was asking if this allows sustaining RAMDisk contents through a restart sequence, not a power-down. Some systems do support this, but it is obviously much more complex to implement.

You may want to read this.

3. Well, I've not though of if I will release or not the source. After all, it's just a Qt UI calling « diskutil erasevolume HFS+ '%s' `hdiutil attach -nomount ram://%llu` » and with a worker thread getting the actual free memory (Mach API). But if people want it, I can release the source under a BSD license.
Wouldn't this also work as a shell script? That would not rely on QT, and would work on every OSX build, on any architecture.
 
Last edited:

Intell

macrumors P6
Jan 24, 2010
18,872
368
Inside
While some specialized systems and a few older ones can maintain ram contents through a soft restart, New World Macs and newer cannot. Only Old World Macs can keep their ram disk and even boot from it across restarts. Some, like the Powerbook series, can keep it even when the machine is completely off, but at the cost of slowly draining the main battery.
 

AmestrisXServe

macrumors 6502
Feb 6, 2014
263
1
I take it then, that there is some directive/protocol in Open Firmware, to flush VRAM? That makes me rather sad, although, now that I think of the chages in NWR, making it bootable (as a logical device) would be very difficult, if not impossible, given the lack of an OS foundation in ROM. (There is no way to instruct the system to look for an EFI in RAM.)

I recall using RAM Disks in 'Classic' MacOS versions, but I don't remember if it was persistent across a reset. The RAM Disk was set in System preferences->Memory, I believe starting in System 7, and MacOS would generate it on start-up, but I thought it was also flushed on reset without additional software. Very few operating systems or environments had a NV RAM-Disk feature.

I also recall using a 1MB RAM-Drive on my Apple II, with a battery pack, to survive power failures. It was a very expensive component, given RAM prices at the time, and once I loaded ProDOS onto it, along with Appleworks, it made for a nice improvement, paired with a 1MB RAM card in the 80-column slot (IIRC).

I also recall that my Profile was in Slot 5, at the time, or Slot 4, as it was not a boot volume. All of this changed when I upgraded to a SCSI controller, a 3.5 Drive controller, and a mouse card. :)

Out of curiosity, what would the rest of you think are ideal applications of a RAM volume in OSX, if you can't place the OS on it. R/W sped for large graphic files? Using it for /swap and for scratch seems somewhat pointless, as many of the operations that would use those memory mapped areas, use physical RAM first, and then use /swap space.

Does it make sense to allocate /swap or similar to a RAM-Disk at all?

With 32/64GB of RAM, it seems logical to assign 8GB-10GB to a RAM-Disk and load an OS or other software, to make operational speed faster, but if that isn't going to work, what else is practical or prudent, in your opinions?

Out of some odd coincidence in the grand cosmic scheme, my netbook crashed from a memory fault as I was writing this.
 

Intell

macrumors P6
Jan 24, 2010
18,872
368
Inside
System VRAM is flushed by the GPU and has never survived system restarts. The reason for New World Macs not being able to keep a RAM disk across restarts is because the memory controller is not able to maintain the memory table before the ram content ls degrade. With older slower ram this was not a problem. But starting with new SDRAM, with faster cycles and quicker degradation, the memory controllers were not able to be initialized and maintain the memory table before the contents degraded.
 

CptSky

macrumors regular
Original poster
Feb 1, 2013
140
13
I'm curious. Is there any difference between this tool and the old System Preference pane Esperance DV?

I found Esperance when I was on Panther and its worked in Panther, Tiger and Leopard.

Since the link above is discontinued, here's my Dropbox link if you want to check it out.

EDIT: LOL! Just tried Esperance on the Mac Pro at work running Mavericks 10.9.1. It works. I have a RAM disk on my desktop with this Mac. Very, very funny to me how this PowerPC system pref works on the latest version of Intel OS X!
Tried it on my laptop. I checked with Hopper the program and it's seems to use the same system call. The difference between both ? (except for the options) The pref. pane won't see more than 2 GiB on Mac with more than 2 GiB of memory and it won't allow allocating a RAM Disk bigger than that. Also, it allows only one RAM Disk. But, something I don't have is the feature for saving / restoring the RAM Disk. Although, I could implement it.

Naturally, if the system is powered down, the contents of NVRAM are flushed. I was asking if this allows sustaining RAMDisk contents through a restart sequence, not a power-down. Some systems do support this, but it is obviously much more complex to implement.

You may want to read this.



Wouldn't this also work as a shell script? That would not rely on QT, and would work on every OSX build, on any architecture.
Well, in a way, a deamon which would save the RAM Disk on the HDD and restore it at relaunch could work. (For maintaining the RAM Disk)

And yes, it could be a simple shell script, but an app allows for more features.
 

Laterne

macrumors newbie
Feb 1, 2014
16
0
I recall using RAM Disks in 'Classic' MacOS versions, but I don't remember if it was persistent across a reset. The RAM Disk was set in System preferences->Memory, I believe starting in System 7, and MacOS would generate it on start-up, but I thought it was also flushed on reset without additional software. Very few operating systems or environments had a NV RAM-Disk feature.
Well I just created a 150 MB capacity RAM-disk using the "Memory"- control panel in native OS9.2.2. Setup is a beige G3 Powermac with 768 MB of built-in SDRAM (PC133-222-520, 133MHz, CL2, sync, unbuffered, non-ECC).

This RAM-disk "survives" restarting thus acting like a regular disk.

I think even an off-powered G3 will retain a RAM-disk as long as the 3.6V 1/2AA buffer battery is healthy.

Some benchmark numbers:
 

Attachments

AmestrisXServe

macrumors 6502
Feb 6, 2014
263
1
Thanks for the verification. I uploaded the above link to reflect that it can work on Panther.

My main concern is that it relies on QT, so if the user doesn't have the correct QT version, the programme would not function.

I would love to have the source, to see if I could make a more universal variation in the future, particularly one that uses the shell to create the virtual disk(s), as that could be used via ssh.
 

takeshi7

macrumors newbie
Jan 12, 2014
26
0
OK. I downloaded the universal binary and installed Ram Disk Creator to my applications folder. When I run the application the icon shows up in my dock, but it is unresponsive and doesn't do anything. Am I doing something wrong?
 

CptSky

macrumors regular
Original poster
Feb 1, 2013
140
13
Thanks for the verification. I uploaded the above link to reflect that it can work on Panther.

My main concern is that it relies on QT, so if the user doesn't have the correct QT version, the programme would not function.

I would love to have the source, to see if I could make a more universal variation in the future, particularly one that uses the shell to create the virtual disk(s), as that could be used via ssh.
Thanks. For your information, Qt can be build as a Framework and than, bundled in the application. What I uploaded includes the required Qt libs, so you don't need your own (and can have whatever version you want installed).

https://bitbucket.org/jpboivin/ram-disk-creator/overview

OK. I downloaded the universal binary and installed Ram Disk Creator to my applications folder. When I run the application the icon shows up in my dock, but it is unresponsive and doesn't do anything. Am I doing something wrong?
Mac OS X version ? Architecture ?
 

takeshi7

macrumors newbie
Jan 12, 2014
26
0
OK thanks for fixing it CptSky. I used the newest version and it is working now, but I am having problems making a RAM disk larger than 2GiB. Is that a limitation of the G5 or something? I have 16GB of RAM installed so I know I have enough RAM.
 

Intell

macrumors P6
Jan 24, 2010
18,872
368
Inside
I believe versions Mac OS X prior to 10.6 or 10.7 cannot make a RAM disk larger than 2GB. It could be a limitation of the 32-bit kernel and Apple not wanting to allow all of the kernel's usable RAM space to be tied up in a RAM disk.
 

CptSky

macrumors regular
Original poster
Feb 1, 2013
140
13
OK thanks for fixing it CptSky. I used the newest version and it is working now, but I am having problems making a RAM disk larger than 2GiB. Is that a limitation of the G5 or something? I have 16GB of RAM installed so I know I have enough RAM.
Ok, yes, it's either a limitation of the 32-bit kernel or a limitation of hdiutil which is a 32-bit app (and might not be able to request more than 2 GB of memory).

I have a solution and I'll try to add the feature as soon as possible.
For the moment, you can RAID multiple volumes by yourself: diskutil createRAID concat "RAM Disk" HFS+ /Volumes/r1 /Volumes/r2

N.B. You must eject the RAID disk in Disk Utility, or the RAM won't be freed. Small issue in this solution...

I believe versions Mac OS X prior to 10.6 or 10.7 cannot make a RAM disk larger than 2GB. It could be a limitation of the 32-bit kernel and Apple not wanting to allow all of the kernel's usable RAM space to be tied up in a RAM disk.
I think the problem is not the kernel as a 32-bit kernel could launch 64-bit apps and address more than 2 GB to the app.
 
Last edited: