3 ms·
> I sometimes build from source and a tmpfs drive is helpful for that so I’m a little concerned I might not have quite enough RAM. I used to do this as well, b
by jakogut 4y ago
> I sometimes build from source and a tmpfs drive is helpful for that so I’m a little concerned I might not have quite enough RAM.
I used to do this as well, but consider that the VFS cache basically does the same thing. The main difference is that cached data can be dropped or flushed if necessary to free memory, whereas this can't be done automatically with tmpfs.
Benchmark both cases and I'll bet you'd be surprised at how little difference there is.
- kevincox 4y agoThe nice thing about swap here is that the kernel is under no obligation to sync the data to disk "soon". I have lots of tmp files that are written and read quickly and never hit the disk. With tmpfs+swap the kernel is free to swap out unused files if that memory is better used elsewhere, but otherwise won't bother touching the disk. I do a lot of builds on my system and most are small enough to entirely live in RAM. But when you build Firefox it is best to start flushing some data to disk.
- jakogut 4y agoThat's another great point. With a large build in tmpfs, you can either run into the size limit of the tmpfs, breaking the build and wasting time, or run out of memory and end up with an unresponsive machine. Entrusting this to the VFS cache has better predictability, and nearly the same performance in many cases.