News for hackers. Stuff that matters.
Re:Tofu – The opposite of a font by boltn on Sunday August 06, 2017 @04:52PM (#14943464)
how would one go about running code/operations on ram as opposed to the hd?
Re:Tofu – The opposite of a font by k__ on Sunday August 06, 2017 @05:15PM (#14943573)
On 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.

Re:Tofu – The opposite of a font by ClassyJacket on Sunday August 06, 2017 @07:28PM (#14944313)
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.

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.

Re:Tofu – The opposite of a font by rocky1138 on Sunday August 06, 2017 @07:52PM (#14944394)
> 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

Re:Tofu – The opposite of a font by Dylan16807 on Monday August 07, 2017 @03:22AM (#14945869)
The first Nexus phone had .5GB RAM and .5GB flash.

In other words, you don't need a ton of space. 8GB split among OS, apps, an running programs would do pretty well, honestly. 16GB is definitely enough. The question becomes more about how much space you want for photos and mp3s, and whether there is actually a benefit to putting those in RAM at all.

Re:Tofu – The opposite of a font by Someone on Monday August 07, 2017 @02:42AM (#14945755)
The hot stuff already is in the disk cache, so _IF_ the applications are written well, I don't think the difference would be large.

Also, you may need more RAM than flash, as large resources may/should be compressed in Flash (and personal data should be encrypted)

Re:Tofu – The opposite of a font by colejohnson66 on Sunday August 06, 2017 @07:50PM (#14944388)
Then 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.
Re:Tofu – The opposite of a font by Retr0spectrum on Sunday August 06, 2017 @05:07PM (#14943530)
On most Linux distros, /tmp is a ramdisk.
Re:Tofu – The opposite of a font by mcpherrinm on Sunday August 06, 2017 @06:51PM (#14944150)
I 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.

Re:Tofu – The opposite of a font by Twirrim on Sunday August 06, 2017 @09:37PM (#14944727)
No.... 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.

Re:Tofu – The opposite of a font by JetSpiegel on Sunday August 06, 2017 @05:23PM (#14943627)
But with only 1 GB capacity
Re:Tofu – The opposite of a font by glandium on Sunday August 06, 2017 @06:47PM (#14944142)
It depends on your setup. The default when no size is given is to use half the RAM.
Re:Tofu – The opposite of a font by colejohnson66 on Sunday August 06, 2017 @08:22PM (#14944486)
Half? That seems kind of excessive. Are you sure that’s right?
Re:Tofu – The opposite of a font by Sidnicious on Sunday August 06, 2017 @09:02PM (#14944610)
I would guess that it’s given that capacity, but the memory is allocated lazily.
Re:Tofu – The opposite of a font by yjftsjthsd-h on Monday August 07, 2017 @07:26AM (#14946686)
Correct; tmpfs only uses as much memory as as is used by the files it contains.