I am a heavy VMware workstation 10.0.3 user, and as such I have 32GB RAM on my system. My only operating system is Arch Linux, using Unity for the desktop.

Usually when I have two virtual machines running with about 3GB RAM appointed to each, really often and at random intervals the whole system becomes unresponsive for a few seconds.

Running "top" at a terminal, the culprit seems to be the command khugepaged, which runs while the system is unresponsive at 100% CPU and then dissapears.

Is there any way to avoid this? I have googled about khugepaged, but I only seem to find ancient posts from 2011 or unanswered questions.

These are my full system specs:

  • CPU: Intel i5 4570@3.2GHz
  • 32GB Corsair Vengeance RAM@2400MHz
  • M/B ASrock Z87 Pro 4
  • What are your swap settings like? That kind of hang is often related to swap usage. Can you check swap next time it hangs? Does it only hang when actively swapping?
    – terdon
    Oct 13 '14 at 16:13
  • Why should it swap with 32GB RAM? It goes nowhere near exchausting the physical RAM. I have a small 1GB swap partition - since it is on an SSD and I didn't want to waste real estate. I haven't changed swappiness, I guess it is at the default value. Oct 13 '14 at 16:19
  • Well, arch has the default set to 60 which means it will start swapping long before the RAM is exhausted. I'm not saying it's swap for sure but it does seem likely. Try setting a lower value.
    – terdon
    Oct 13 '14 at 16:44
  • Ok, I have set it to 5. I will let you know if it made a difference. Oct 13 '14 at 16:54

I have similar problem on Ubuntu. The workaround I use is:

echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag

The source of the workaround is in a Fedora bug report “khugepaged eating 100%CPU”. The bug was never fixed.

This is less drastic then disabling entire transparent_hugepage support. The detailed explanation of what the command does can be found in the documentation of transparent hugepage support.

  • echo never | sudo tee /sys/kernel/mm/transparent_hugepage/defrag; echo 0 | sudo tee /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
    – Treviño
    Nov 29 '16 at 11:48
  • @Treviño, may I ask what the difference is to what the author of the answer is proposing: why should one use | sudo tee in stead of >?
    – Joma
    Dec 1 '16 at 12:01
  • 1
    @Joma the sudo echo $value > output doesn't work in Ubuntu, you need to use the tee trick, or do it from sudo -s shell.
    – Treviño
    Dec 5 '16 at 22:41
  • 1
    Seriously, I love you for that, @pawel-jasinski – the first time in 5 years that I can actually WORK with VMware without that it regularly freezes both host and guest OS. Jul 27 '18 at 16:13
  • 1
    @Joma The first command has to be run from a root shell. With sudo echo X > Y, only echo X is run as root but > Y (forward output into a file) is not. Jul 27 '18 at 16:15

khugepaged might be the problem, try the following:

echo never > /sys/kernel/mm/transparent_hugepage/enabled

this helped me to resolve this issue on recent arch linux...

  • 4
    Hi and welcome to the site! We expect answers to be a bit more detailed here. Could you perhaps edit your answer and explain what the command you suggests does and how it would help?
    – terdon
    Jan 14 '15 at 12:37
  • 1
    @ArchUser also if you are not sure this is the solution please post as a comment.
    – vfbsilva
    Jan 14 '15 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.