Something to keep in mind is memory that isn't actively used by an application is used by disk cache. The kennel will weigh keeping a page of application memory vs a page of disk cache. If the application is less likely it will move the page to swap despite "used memory" potentially being quite minimal.
- Tom On Mon, Feb 20, 2023, 16:01 Ben Koenig <[email protected]> wrote: > Memory management doesn't seem as straightforward as it used to. My > desktop has 16GB RAM and rarely push that all the way, but I tend to see a > lot of swap usage when leaving the computer on for days at a time. > > bash-5.1$ uptime > 14:48:50 up 2 days, 23:16, 5 users, load average: 0.55, 0.32, 0.12 > bash-5.1$ free -m > total used free shared buff/cache > available > Mem: 15947 2801 855 734 12290 > 12084 > Swap: 15939 1169 14769 > > Caching, buffering, swapping... I keep looking at the "free" number and > panicking. > -Ben > > ------- Original Message ------- > On Monday, February 20th, 2023 at 8:53 AM, Jason Barbier < > [email protected]> wrote: > > The answer is almost always yes, but not for the reason most people think. > Haden James covers it pretty well here > https://haydenjames.io/linux-performance-almost-always-add-swap-space/, > but you can also find all the information he covers in the kernel > documentation around linux memory management and the virtual memory system. > TL;DR there are times that the kernel needs to evict pages or deal with > unmovable blocks of memory. If you have no swap available the kernel cant > do some of the various maintenance tasks and the memory eventually becomes > hopelessly fragmented and your system grinds to a halt. The more adequately > speced your system is the longer that horizon is, but according to the > people that designed the system you need some swap. > > > On 20 at 04:11 someone claiming to be Jake Bottero said: > > Running RHEL on a virtual (cloud) server, is there any benefit from > creating a swap file? > > > --- > GPG: https://corrupted.io/kusuriya.pub > > >
