"Locking" a File in RAM in OSX
Is there a way to do this, via some wicked looking command line thingy? I want to make it such that when a file is accessed, it is already mapped in real RAM, and stays there, regardless of useage. Is there a way to do this? Yeah, I guess this is much like a RAM disk situation, but I was curious if there was a way to invoke this directly on a "file", rather than setup a logical volume that actually resides in RAM. RAM-RAM-RAM, rammity, RAM-RAM... (had to use up my quota)
Comments
On an off topic note, love that quote from Mr Dubya, one of my favourite's is "War is a dangerous place."
Now I guess they should have banned me rather than just shut off posting priviledges, because kickaha and Amorph definitely aren't going to like being called to task when they thought they had it all ignored *cough* *cough* I mean under control. Just a couple o' tools.
Don't worry, as soon as my work resetting my posts is done I'll disappear forever.
Unless you are writing to a file a lot (little writes), and you don't actually care about the changes (so they can go poof), the only benefit to a RAM-disk-like setup would be that it caches everything into memory. To get that benefit you could simply write a small program that would go over every file and read it. That would cause it to be brought into memory, and unless something else pushes it out, it will simply remain there, dormant. Even if the reading program terminates.
Now, this will not really help you with 3d games, as what they create in memory is not exactly what is on the HD. Instead they build structures in memory that are described in compressed files on the HD. A RAM-disk will never help with these programs... they are already do that sort of work themselves.
Originally posted by mattyj
I'd love to know that too, couldn't you then customise your ram to run certain things faster? Such as specific texture files for UT2004 etc...
On an off topic note, love that quote from Mr Dubya, one of my favourite's is "War is a dangerous place."
Hehe...I like the entrepreneur one because it demonstrates both arrogance and cultural ignorance at the same time.
Now I guess they should have banned me rather than just shut off posting priviledges, because kickaha and Amorph definitely aren't going to like being called to task when they thought they had it all ignored *cough* *cough* I mean under control. Just a couple o' tools.
Don't worry, as soon as my work resetting my posts is done I'll disappear forever.
When the computer shuts down, no more file.
Outside of that, it'd only save on load times for games and such. It'd probably slow down the game (having less RAM at its disposal) more than it would speed it up.
... unless you had 8 gigs or something.
With the exception of OS code that deals with the kernel, VM, and driver systems, there is almost nothing that will benefit, and those things are best marked at compile time... and I don't think we have any OS engineers on this list.
As long as you have enough memory, nothing will drop out. It is that simple.
If you don't have enough memory then the stuff you are using most should be the stuff in memory. The chances that you, the user, are going to be able to predict what seldom-used file is suddenly going to become needed is close to 0.
And as to your idea of answering the question... it is entirely appropriate to point out that this is not a route to a valid solution. Purposing to put blinders on peoples' thinking so that they can only answer a narrow question on a subject the asker doesn't really understand is a counterproductive practice.
Let's just say the points you bring up are certainly valid, and I was well aware of OSX's comprehensive abilities prior to your posts, yet, I have not given up the notion of tweaking and experimenting with stuff. It's my own time to use as I see fit, whether it ends up being constructive or merely educational. I appreciate your inputs on the topic, otherwise.