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 Format9 min read
The Epochalypse
On 2nd November 2000, a man calling himself John Titor began posting on Art Bell’s BSS forums, claiming to be from the O future year of 2036. Titor painted a grim version of the 21st century, a cross between Pat Frank’s 1959 post-apocalyptic epic Ala
Linux Format1 min read
Ultimate Desktop Upgrade!
LXF316 will be on sale Tuesday 28th May 2024 Word processors that can help craft that novel you’ve always been talking about and organise large projects. Revive the old roleplaying system for a digital age as we recreate our own play-by-mail gaming
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