Answers
Q Early swap usage
I’m using Kubuntu 19.10 and noticed that swap was used very early after starting the desktop, even if there’s still RAM available (4GB RAM, KDE Plasma desktop). How can I troubleshoot what’s causing this early use of swap? isn’t swap supposed to be used only if RAM is full? Can I do something about it?
Leon Butcher
A This is not a problem to be solved, it is the system working as it should. Memory management in Linux is both advanced and mature – years have gone into optimising it. Data is moved from memory to swap because it is unlikely to be needed but has to remain available in memory in some form. For example, code used when starting up system services may not need to be accessed once those services are running, so it can be safely paged to swap.
Linux will try to use all the memory available to it. RAM not occupied with code or data will be used for filesystem caching to speed up disk usage. So swapping out unneeded data can make your system faster. It is also worth bearing in mind that if RAM does become short and the system needs to swap out
You’re reading a preview, subscribe to read more.
Start your free 30 days