Remix.run Logo
man8alexd 12 hours ago

You are right, it is not a rule of thumb, and you can't determine optimal swap size right away. But you don't need "extensive runtime analysis". Start with a small swap - a few hundred megabytes (assuming the system has GBs of RAM). Check its utilization periodically. If it is full, add a few hundred megabytes more. That's all.

ZoomZoomZoom 11 hours ago | parent [-]

It's not like it's easy to shuffle partitions around. Swap files are a pain, so you need to reserve space at the end of the table. By the time you need to increase swap the previous partition is going to be full.

Better overcommit right away and live with the feeling you're wasting space.

rascul 9 hours ago | parent | next [-]

> Swap files are a pain

Easier than partitions:

    mkswap --size 2G --file swap.img
    swapon swap.img
man8alexd 11 hours ago | parent | prev | next [-]

Exactly opposite. Don't use swap partitions, and use swap files, even multiple if necessary. Never allocate too much swap space. It is better to get OOM earlier then to wait for unresponsive system.

direwolf20 11 hours ago | parent | prev [-]

Hast thou discovered our lord and savior LVM?