Although Linux efficiently manages system resources, thrashing can sometimes occur. Here's how to fix the SysRq key problem.

You have worked on your Linux system for a couple of hours and everything is fine. Then click another link, open another web app and everything freezes. If you spend time running web applications on your older laptop, chances are you've encountered this problem before.

What if there was a way to quickly resolve these situations without shutting down your system? The SysRq key combination will help you with this. Let's take a closer look at how you can use this keyboard shortcut to prevent thrashing your computer.

Thrashing – Why Me?

The most likely scenario is that your machine has gotten into a dreaded state called thrashing. This is the worst case scenario for a memory condition caused when you run out of memory. If the machine starts beating, all you can do is try to end the runaway process or, alternatively, stop everything and recover later. And later, when you recover, you need to avoid starting so many applications at the same time.

Some would suggest buying a newer computer with more memory to run resource-hungry applications. If you can't, there is also a workaround to resolve this issue.

Related: How Much RAM Do You Really Need?

Solving thrashing using the Magic SysRq keyboard shortcut

So you still have your old machine for some reason, but now it's up to you to take care of it. It is often not happy with modern websites that have now largely adapted to client-side processing. It stops. It freezes. It frustrates you.

You can't toss your computer around the room, but you can handle the situation with the help of a special keyboard combination. This is the most reliable way to shut everything down without holding down the power button.

  1. Press Ctrl + Old + Fn Keys at the same time on your keyboard.

  2. Press the SysRq Key with the other hand. If your keyboard does not have the SysRq label, press the key Prtscn Key.

  3. Free that Ctrl + Old + Fn Buttons while holding down the button SysRq Key.

  4. Press the following keys in this order: R., E., I, S., U., B..

  5. Release all buttons.

After that, wait a few seconds and your machine will stop beating. The above keyboard shortcut performed the following tasks on your system.

  • R.: Switch the keyboard to Raw mode.
  • E.: Send the SIGTERM signal to all processes except init. This signal is responsible for terminating the specified processes.
  • I: Send the SIGKILL signal to all processes except init.
  • S.: Synchronize all file systems currently mounted on the system.
  • U.: Re-mount the file systems in read-only mode.
  • B.: Restart the system.

Fixing an Unresponsive Linux System

When the memory is low, certain processes can affect the way a computer works. In such situations, the SysRq keyboard shortcut can be useful. Alternatively, you can restart your system to immediately kill the processes that might be causing the problem. But this is not a viable choice for everyone.

You can also monitor running processes on your Linux system with the ps command. The command outputs information such as the process ID, the time allocated by the CPU to the process, the current TTY shell, and more.

How to view process information on a Linux system with the Ps command

Do you want to know what processes are running on your Linux computer? Learn how to use the ps command to find out what is running.

Continue reading

About the author

Russ Frazier
(4 articles published)

Russ has more than 20 years of experience in software development on Unix and Linux systems as an electrical engineer in the areas of microelectronic CAD, IT systems and customer-specific APIs. He holds a BSEE from San Jose State University and an MBA from North Carolina State University. In his spare time he composes and plays music.

By Russ Frazier

Subscribe to our newsletter

Sign up for our newsletter to receive tech tips, reviews, free e-books, and exclusive offers!

One more step …!

Please confirm your email address in the email we just sent you.