Re: Is there a way to make the pi use swap?
On Fri, Sep 14, 2018 at 8:16 PM, Alan Corey <alan01346@gmail.com> wrote:
> My /etc/fstab just has
> /var/swap2 none swap sw 0 0
> That's for a swap file which was made by dding 0s into it, then running mkswap.
>
> You'd replace /var/swap2 with /dev/sda2
>
> Sounds like you're just not loading it from your fstab. Should load
> every boot. Nothing new or tricky there.
In addition, it also helps to set swappiness to a low value, like 1 or
3, on modern kernels. That has the effect of telling the kernel to
prefer to keep things in memory.
With swapon and low swappiness I can actually run a C++ compiler with
multiple jobs and without an OOM kill.
Jeff
Reply to: