OSX: Compile in RAMDISK?

BlitzMax Forums/BlitzMax Programming/OSX: Compile in RAMDISK?

salric(Posted 2006) [#1]
Hi All,

I stumbled across this cool little freeware tool that allows you to create a ramdisk on OSX. For those who never played with ramdisks on the Amiga (or earlier apple OS's for that matter), it's a mountable disk in RAM rather than on your HD - making file access virtually instantaneous.

You can download the tool here:
http://www.mparrot.net/index.php?page=freewares&lang=en

Or try Velox - another tool that does the same job:
http://www.cutolo.tk/

Alternatively you can use this script to make a 128mb ramdisk:

#!/bin/bash
VolumeName="RAMDisk"
SizeInMB=128
NumSectors=$((2*1024*SizeInMB))
DeviceName=`hdid -nomount ram://$NumSectors`
echo $DeviceName
diskutil eraseVolume HFS+ RAMDisk $DeviceName

Remember to chmod 755 (whatever you call the above file) i.e. if you save it as makeramdisk then chmod 755 makeramdisk will change the permissions so you can run the script.

I'm running 10.4.4 & have 512Mb of ram on my Powerbook G4 1.33Mhz, the thing is - I don't notice any speed difference when starting my Blitzmax game - it normally takes about 20 sec to load images for the game & running it from a ramdisk seems to make little difference? Difference reports around the net say it's 'amazingly fast' etc.

I'd love it if someone else could give this a try & perhaps point out what I'm doing wrong?

Cheers,
-R

p.s. I've just solved the problem - Clarkwood makes a commercial ramdisk solution, & also a utility called peek-a-boo, running this application shows that virtual memory is paging to the hd - net result - not enough ram.... anyhow - this page explains it all...

http://www.clarkwood.com/rambunctious/RDOSX.html

Geez - I remember when 16k was a lot of memory... 512Mb isn't enough now :-)


Dreamora(Posted 2006) [#2]
Nothing, but loading images depends more on your graphic card bandwidth as they are loaded as pixmaps and then must be converted and sent to your graphic hardware.
At worst you are overloading your 8 - 32MB VRAM (iBooks don't have more, right?) because BM does not support S3 texture compression. Images are always in full size in VRAM in OpenGL, because BlitzMax does not support S3 texture compression, which would lower the VRAM size of an image (which is width * height * bitdepth, not the filesize you actually have).


Will(Posted 2006) [#3]
He has a powerbook, so he is unlikely to be overloading. My gf's powerbook has 128mb vram, so thats unlikely to be the issue. Maybe the converting process is extremely slow - it would appear to be that way with loading ogg files (thats hella slow! SO BAD!)