Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Some times my laptop gets stuck due to excessive usage of RAM when I open bulky applications. So if it does not respond I shut down the laptop using the power button. Does this damage Ubuntu in any way? Can it give rise to security problems or vulnerabilities?

share|improve this question
2  
There's a good list of what to do when Ubuntu freezes that can help you out of the 'stuck computer' problems, which you can try before resorting to the power button. –  Charles Green Jun 24 at 13:31
1  
If it's swapping like mad and not responding to input, you can try waiting a few hours. Odds are good that whatever program is causing the problems will allocate too much memory and be killed by the OS, at which point the system will stabilize and be usable again. –  Mark Jun 25 at 4:28
1  
I always figure if the computer's been frozen for a while, and the hard drive's quiet, then either everything's been written to disk, or it's not going to be. –  Wossname Jun 25 at 5:13
    
How does one detect if an SSD is quiet(er)? –  Nate Lockwood Jun 27 at 13:39

3 Answers 3

up vote 18 down vote accepted

It won't cause security problems or vulnerabilities.
But it can cause damage on your OS and loss of data depending on the tasks that are running at the time.
That being said, your computer still shouldn't get stuck at high ram usage.
Are you using swap?

share|improve this answer
5  
If it can damage the OS it can cause security problems or vulnerabilities. It simply has to damage the right portions of the OS (sure, quite unlikely that the OS gets damaged, runs as before with nobody noticing but without critical security functionalities... however still possible). –  Bakuriu Jun 24 at 16:01
13  
@Bakuriu As long as we are talking about unlikely but still possible things, isn't it also possible that a crash will do something good? Maybe...produce a great book that nets someone a ton of money? –  Phil Frost Jun 24 at 20:12
    
@PhilFrost Sure, see Boltzmann brain for the most extreme documented variant of that idea. –  Volker Siegel Jun 25 at 6:19
    
@Bakuriu Ubuntu uses ext4, which has a journal, so in the worst case, there would only be a half-installed package) –  Ramchandra Apte Jun 25 at 9:16
3  
@RamchandraApte Ubuntu uses whatever filesystem I choose... –  Bakuriu Jun 25 at 9:50

Obviously you will loose the amount of data that is in your RAM at that time and hasn't been written to disk, yet. Also there is a theoretical chance of data/file-system corruption.

From my own experiences I can tell you that I'm hard-resetting my PC 4-5 times a day over the last 5 years and never had the problem of corrupted filesystems. I think ext3/ext4/ufs are pretty robust for this kind of failures.

In opposite to this I think NTFS is far more prone to this. On my Windows gaming rig I have a ~15% chance of file system corruption after a blue-screen and I'll have to to boot from disk to run a file system repair tool in that case ... **sigh**

share|improve this answer
10  
why would you need to hard-reset that often? –  Bogdacutu Jun 24 at 19:09
    
...in particular with a Linux kernel running. Of course on Windows, I'm still quite familiar with the lovely feeling of a couple of BSODs in a single day, but kernel panics I've only experienced like... 5 times in total or something. Swap-caused almost-freezes are rather more common of course (hardly the OS's fault), but this isn't really a reason for hard-reset, is it? Normally still quite easy to top out the process or just killall it. –  leftaroundabout Jun 24 at 23:00
1  
@leftaroundabout: Kernel panics aren't the only way a system goes down; they're just one of the few ways the OS tells you about. :) Every month or so, my laptop likes to act up by leaving little bits of garbage on the screen for a little while before it just totally freezes. (I think my video card is flaking out.) Happens about the same in Windows, about as frequently...though Windows occasionally blue screens. (Seems it tries harder to recover and limp along.) –  cHao Jun 25 at 3:21
    
@Bogdacutu some drivers, especially video drivers, including intel, nouveau, and even nvidia blob, are quite a crap. I've experienced really frequent Oopses, which often led to full freeze, as well as just GPU hangs, all of which made me hard reset. Sometimes SysRq+REISUB worked, other times I just had to press reset button (or hold power button on laptops). –  Ruslan Jun 25 at 7:26
1  
An ext4 filesystem can not be corrupted, which Ubuntu normally uses, because ext4 has a journal (half-written data will be discarded on next boot). –  Ramchandra Apte Jun 25 at 9:17

Maybe this will help a little, by default ubuntu and others swappiness are set to 60 , when your system reaches 60% of ram usage it changes to swap which is slow.

  1. Open this file on gedit or nano using: gksudo gedit /etc/sysctl.conf OR sudo nano /etc/sysctl.conf

  2. Add this to the end of the file: vm.swapiness = 0

  3. Save the file and reboot.

Also when it gets slow you should check if it is really using swap which slows down the system, otherwise the above changes wont help.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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