5 ms·
how would one go about running code/operations on ram as opposed to the hd?
by boltn 9y ago
how would one go about running code/operations on ram as opposed to the hd?
- Retr0spectrum 9y agoOn most Linux distros, /tmp is a ramdisk.
- JetSpiegel 9y agoBut with only 1 GB capacity
- glandium 9y agoIt depends on your setup. The default when no size is given is to use half the RAM.
- colejohnson66 9y agoHalf? That seems kind of excessive. Are you sure that’s right?
- Sidnicious 9y agoI would guess that it’s given that capacity, but the memory is allocated lazily.
- yjftsjthsd-h 9y agoCorrect; tmpfs only uses as much memory as as is used by the files it contains.
- mcpherrinm 9y agoI don't think this is nearly universal - certainly none of the systems I use have /tmp as tmpfs. /dev/shm, on the other hand, is almost always guaranteed to be a tmpfs on glibc systems.
- Twirrim 9y agoNo.... some, sure. Not most. RHEL7, and all it's derivatives (CentOS, Oracle Linux etc.) don't use tmpfs for /tmp by default, and they are arguably the most used linux distros in the world.
- k__ 9y agoOn most operating systems you can use part of your RAM as disk. Format it like a regular disk, mount it and save files on it. The data is gone if you restart tho.
- ClassyJacket 9y agoI've wondered for a while how fast we could make a phone (or PC) that operated entirely in RAM disk and used flash storage just as a one-to-one backup and storage when powered off. Obviously this would require your phone to have 128GB of RAM. You'd write changes to the flash storage, but it'd mirror RAM as closely as possible without destroying power management or storage life. Imagine if there was no lag opening any app because everything was in memory. Imagine your code getting simpler because you don't need to load assets off disk - that's done all in one go at boot time. You want to render an image out? Just do it - a reference to a file is a reference to a file, no loading it or wondering if it's loaded. Flash storage in phones is fast enough these days that it's probably not worth it, and simply giving traditional phones lots of RAM will probably give 80% of the improvement for 20% of the cost. But I've been curious about the idea for some time.
- colejohnson66 9y agoThen if the phone had originally 4 gigs of ram, you’d need an extra 4 gigs of ram for each app. I guess you could partition your ram to have 4 gigs as scratch, but that would limit the number of programs you can run.
- rocky1138 9y ago> I've wondered for a while how fast we could make a phone (or PC) that operated entirely in RAM disk and used flash storage just as a one-to-one backup and storage when powered off. Obviously this would require your phone to have 128GB of RAM. You'd write changes to the flash storage, but it'd mirror RAM as closely as possible without destroying power management or storage life. PuppyLinux did this for the Eee PC. Worked wonderfully. The only problem was that the distro eventually became outdated, filled with old packages. http://www.puppylinux.org/wikka/EeePC http://www.puppylinux.org/wikka/EeePC