I have the following setup: Gentoo Linux, kernel 4.19.52, AMD Ryzen 5 1600, 16G of RAM (of which up to 8G is used as ramdisk - mounted as tmpfs). I have also set up 32G of swap partition. The following issue has been with me for like half a year and a couple of kernels.

When I compile relatively large applications like chromium or firefox, eventually (like half an hour into compilation) my system becomes unresponsive. From what I have managed to observe, it seems the system starts to swap heavily (the kswapd is using significant % of the CPU), but to my surprise, the actual swap space is almost unused. It looks like for some reason the system runs out of RAM but also does not want to use the swap space.

Any hints or ideas on what to look for? Debugging of the issue is somehow difficult, as everything runs smoothly for like 30-60 mins until it "almost" hang (by that I mean the mouse moves like 1 inch per 30 secs) - which make it also unobservable :(

Maybe someone have come across this issue? I'll be grateful for any tips...


Base /proc/meminfo output available at: https://pastebin.com/SQJ49mhD its difficult to capture it during the "problem state" as the system becomes unresponsive - I'm unable to do anything except for hard "power off"

  • do you have some sysctl parameter to try to fix this?
    – c4f4t0r
    Jul 20, 2019 at 21:32
  • Please edit your question to add the contents /proc/meminfo during the problem state. Jul 21, 2019 at 2:28
  • Are you using an ssd to swap to? Do you have the discard (trrim) option for it? Some ssd's handle trim very slowly, and for filesystems I've seen people suggest that you not mount them with discard, but run fstrim from cron once a day at a quiet time. I don't know if there is an equivalent for swap, though.
    – meuh
    Jul 22, 2019 at 9:44
  • Like I said, the actual swap space on the disk seem to be almost unused. However, I think my issue is the same as this: unix.stackexchange.com/questions/28175/… which as I understand does not have a clear resolution for now...
    – Marek
    Jul 27, 2019 at 5:23

1 Answer 1


Modern browsers are a beast to build. Very likely the virtual memory system is moving lots of pages around, but not enough to significantly page out to disk.

Linux From Scratch reports 6+ GB memory used to build Firefox, and 1.25 GB per thread for Chromium with WebKit.

Get more memory, or reduce the number of jobs with any -j switches. Or use prebuilt binaries...

  • Its not only the browsers, they are just the most obvious example. And I have like 12 GB of RAM available, which really should be sufficient. Also, why the swapping does not seem to use the swap partition and why does it make the system completely unresponsive?
    – Marek
    Jul 21, 2019 at 5:21
  • Insufficient data to determine where the bottleneck is. For large build jobs, could be on memory, CPU, or disk, they hit all of those hard. Look at each of those to determine where the problem is. Starter set of essential tools: medium.com/netflix-techblog/… Jul 21, 2019 at 20:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .