Hacker News new | ask | show | jobs
by ars 3249 days ago
> Not sure if ramdisks are pinned though.

Ramdisks will go to swap. A memory leak will force the entire ramdisk into swap, and reading it back into memory afterward is 10 to 100 times slower than reading normal files off of a disk.

1 comments

> Ramdisks will go to swap.

Assuming that you have swap. I don't; I want my SSD to stay alive.

If you have a memory leak, and a ramdisk, and no swap then the OOM killer will trigger.

Hopefully it will target the program with the memory leak, but this is not guaranteed.

Swap is useful because you can shift unused memory onto disk. There are many programs that allocate (and write) a lot of memory that they never afterward use.

By having swap you make more room for cache in memory.

SSD doesn't matter here - this is not swap thrashing, but rather occasional writes.

Does anyone have actual data on swap on SSDs in 2017?