Hacker News new | ask | show | jobs
by thot_experiment 918 days ago
Ramdisks are extremely slept on, there is a lot of stuff you can kludge with a ramdisk in a pinch. I had to do some video stream processing the other day and I didn't have time. So I just made a ramdisk and read/wrote jpegs at 30fps, yeah it's stupid as hell, but it worked when I needed it to and that's what matters.
3 comments

I have various folders mapped to RAM, like e.g. /var/tmp.

This has many uses, as you said. E.g. sometimes even just downloading a video stream to disc creates a temporary file in the destination folder for every fragment. I just d/l those into /var/tmp first and then mv the finished video to where it's supposed to live. I'm sure both my SSD and HDD are grateful! =)

Doesn’t this make your var and temp rest on boots?
Yes, and that's 100% okay for /tmp. For /var/tmp it's a bit more complicated, but it hasn't bitten me yet.
Hey, it's not stupid if it works! In the context of this particular game, I can't see why it would be a bad idea. Even if you need to conserve some kind of state... gzip the whole thing and copy it elsewhere, it's going to take seconds!
When my SSD was failing (ran out of writes) I used a RAMdisk to edit audio for something. It worked great for that since I couldn't do it otherwise!