Re: Swap
Matus UHLAR - fantomas <[email protected]>
| Newsgroups | gmane.linux.debian.user.laptop |
|---|---|
| Message-ID | <[email protected]> |
On 04.02.16 21:12, Jos Collin wrote: >How much swap space does 4GB ram ideally requires ? I have been using the >rule "RAM size x 2" for calculating the size of swap. But as the RAM sizes >are bigger nowadays, is this a wrong calculation ? yes. > I mean, is it okay if I >use 1 GB of swap space (or lesser) for a 4gb RAM ? it highly depends on your usual needs and how much of RAM you use in peaks. I run without swap on many machines for some years already. Do you monitor your RAM usage? on some servers I use 3GiB, with the only reason for having swap is to notice system slowdown when it starts swapping. You can try e.g. enable zswap so kernel will use the 1GB swap even more effectively. Similarly you can reserve some memory for zram block device and swap to it. Another trick is to use swap and mount /tmp on tmpfs (which means, on virtual memory), although some people discourage this because (some) people or applications tend to fill /tmp with bloat. ...you can avoid this problem by limiting tmpfs size