Friday, 24 June 2016

Magic Sys Rq Key

The Issue


So the other day I was working with Android Studio on my Low Hardware Spec Ubuntu Machine. I decided to build an apk as emulators are simply not an option. But Guess what , my pc used all of the possible RAM and all the possible swap memory and hung(that's pretty rare for Ubuntu!).

I tried opening a terminal Ctrl+Alt+T hoping to kill android studio process. But the PC was unresponsive. This is despite using all the regular optimizations for android Studio that I found on Ubuntu Forums and Stack Overflow.

Any noob would have now headed out towards the power button. If you ever do come across this situation please do not use this approach. This is the last thing you should do, only if everything else fails.


Magic SysRq Key


Behold, it was the time to use the magic sysrq key. Trust me you might be able to even prank your friends in the lab. Press this combination on the keyboard and restart the pc when asked to debug his code, pretending that you are pressing some shortcut related to the IDE.

The Magic SysRq key is a set of low level commands that is understood by Linux Kernel irrespective of its state. If your are on Ubuntu use the combination

Ctrl+Alt+Printsceen

Press these keys and do not release them. Mean while begin typing REISUB. This will restart your system. You can find detailed info on this wikipedia page.

How to Remember

TRICK: REISUB is the letter combination obtained upon reversing the word BUSIER.


The Fix 

I have managed to reduce by Ram usage by changing my Desktop Evironment from the Ram hungry Unity to LDXE. In case, you wanna save battery on your laptop , or are low on RAM, do give it a try.






No comments:

Post a Comment