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.

About a few months ago I was using Ubuntu (doing something in the command line) when it started lagging really bad. I would hit S (or any other key) and like 20 seconds later it would show up in my terminal.

Naturally I killed the machine and rebooted. The system started working just fine, but about 30 minutes later it did the same thing. Now I'm forced to use Ubuntu in 30 minute spurts. I've looked at my running processes and none of them are taking large amounts of CPU or RAM.

Luckily I've dual-booted so I could still use my machine. Now I need to get this fixed and I'm wondering what my options are. Will I be forced to do a fresh install or is there another way?

share|improve this question
    
does this also happen if you don't "use" ubuntu for 30min after bootup? –  aatdark Jan 29 '11 at 23:03
    
It only happens when I'm using it. Otherwise it will sit there just fine. And I can use it for 30 mins lag free. –  Lucas McCoy Jan 29 '11 at 23:12
1  
do you get some messages in /var/log/syslog or /var/log/kern.log indicating a problem? –  aatdark Jan 29 '11 at 23:41
    
Here is my /var/log/syslog: pastebin.com/HbAC8p8e –  Lucas McCoy Jan 30 '11 at 2:16
    
And here is my /var/log/kern.log: pastebin.com/8V6Z48vk –  Lucas McCoy Jan 30 '11 at 2:17

3 Answers 3

up vote 3 down vote accepted

First install htop and iotop:

sudo apt-get install htop iotop

Then start three terminals, and run each of these commands in each of them:

iotop

This command will show you any process that is writing to the hard drive

htop

This command will show a more colourful alternative to top. Pay special attention to the amount of free memory. If this starts running low, you will probably soon see an increase in disk writes in the iotop-command (above), which in turn may indicate that something is leaking memory...

tail -f /var/log/messages

This command will show system messages. If some program crashes or such, more info may popup here. So when you start noticing system lags, check the output from this command...

Of course, non of the above actually solves your problem, but it might help diagnose it.

Cheers /N

share|improve this answer
2  
Nicke, rather than just copying my answer practically word for word (askubuntu.com/questions/18564/…), it would be more respectful to simply link the original question. Not impressed. –  Scaine Jan 30 '11 at 14:37
2  
-1 for plagiarism. Also once my system starts lagging I'm not able to type commands such as this because after about 40 seconds of lagging the system locks up and I have to do a hard reboot. –  Lucas McCoy Jan 30 '11 at 16:00
1  
What? I certainly did not! And what do you mean by "word-by-word", there are hardly any similar sentences (except of course for the commands which are common knowledge). Besides, @Scaine, the above post addresses the specific issue of a suspected memory leak which I don't think yours does. I would not mind at all linking to your post now that I know it exists, but accusing me of plagiarism I certainly do mind -- there are polite ways of pointing out similarities in topic without insinuating deliberate theft! –  Nicke Jan 30 '11 at 18:48
1  
Then my apologies, Nicke. Seemed far too coincidental to use specifically the same commands. I mean htop when top would do fine for example. Also, dmesg is more common, but I prefer tailing the kern.log because it's realtime. I thought it was too coincidental. Again sorry. –  Scaine Jan 30 '11 at 19:10
    
Coincidence, I don't know: any rudimentary troubleshooting of system lags would include monitoring cpu load, disk load and check for any suspicious log messages... I think htop is more handy than top (mouse support, scrollable process list, less cluttered output etc) -- and we're probably not the only ones. 'tail -f' is the standard command to "follow" a file; i.e print new lines as they are written to it... dmesg just dumps the content of /var/log/dmesg once and then quits -- no continuous output of new lines. So, concidental? Perhaps, but enough to presume "plagiarism"? I don't think so... –  Nicke Jan 30 '11 at 20:45

Check your memory usage - I run the System Monitor applet in my panel, and it lets me know if I'm getting close to running out of memory. When I run too many programs, I have similar problems - really slow responsiveness.

If it is a memory problem, try using top or the full system monitor tool that you can launch from the applet to identify which process(es) are using up your memory. Often you can remove it and not have problems, but double-check first.

share|improve this answer
    
This isn't the case. It's not that I have too many programs running. It will lag with just 1 terminal window open. I have 3GBs of RAM and a Dual-Core CPU. –  Lucas McCoy Jan 29 '11 at 22:55
    
Regardless of how many programs you run, there may be a buggy process consuming memory. –  Nicke Jan 30 '11 at 9:05
    
But none does though. –  marines Mar 12 at 14:36

Your real problem could be overheating. I had this exact same problem. All I did was elevate my laptop by keeping it on Dana's Text Book of MIneralogy (4th Edition). Your problem is overheating if you hear your fan whirring at a high speed. It is actually struggling to keep your laptop cool. Processing power is diverted to keep the fan going.

share|improve this answer
    
If it is overheating, CPU may simple shut itself down, and cause your system to shut off. I have the same slow down issue on 14.04, and the current workaround is really to reboot. –  Antony Aug 19 at 13:18

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.