Linux Format

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.

More from Linux Format

Linux Format12 min read
Let’s Code Some Demos Like It’s 1990!
Ferenc Deák never throws anything away, which is why he still has all his demoscene files. Sadly, it also means his fridge is a no-go zone. It all started when this author’s beloved retro PC, used to host nostalgic gaming sessions, I suddenly suffer
Linux Format1 min read
Nvk Is Go!
"NVK, the open source Vulkan driver for Nvidia hardware in Mesa, is ready for prime time. The merge request has landed, getting rid of the nonconformant implementation warnings and signalling to distros that it’s now time to start shipping NVK to use
Linux Format3 min read
Kernel Watch
Linus Torvalds announced the fourth RC (Release Candidate) for what will become Linux 6.9 in another few weeks. In his announcement, he noted that there was “Nothing particularly unusual going on this week – some new hardware mitigations may stand o

Related Books & Audiobooks