LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-06-2008, 09:06 PM   #1
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Rep: Reputation: 38
system temporary locks randomly in ubuntu hardy and zenwalk


Hello, I am running Ubuntu Hardy and Zenwalk 5.2, both up to date. a while back when Mepis 7.0 was released I had the same problem, so I kept running Simply Mepis 6.06lts (2.6.15.xx kernel) without this problem (it had less support for usb hardware tho). As I needed/wanted to run newer versions of programmes that would not under my then current kernel, I decided to upgrade to Ubuntu Hardy at its release date. Now I have all software up to date but the system randomly and temporarily freezes, something it does since the upgrade (which was a clean install btw) To see if the problem was Ubuntu/Mepis related i decide to install an other distro, Zenwalk 5.2 with an even higher kernel than current Ubuntu, but under Zenwalk the freezes in the same way: the mouse stays responsive, but clicks are not executed straight away. same with keystrokes; all strokes are registered but not shown straight away, they will appear on screen after the freeze period has gone, as do mouse clicks get executed after this period as well. This happens randomly in any program and more frequent if more programs are running at the same time. This system is a Acer Laptop TM2480 with a celeron 1.73ghz cpu, intel 945 graphics, 1gb ram. the periods of temporary unresponsiveness can last up to a minute. Does any one recognize this and may be found a solution or what could cause this?

thanks
ron
 
Old 07-06-2008, 09:19 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I'd run top in a terminal window to see if anything specific is eating up your CPU.
 
Old 07-07-2008, 10:34 AM   #3
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Original Poster
Rep: Reputation: 38
I will do that and see what happens, thanks for the tip. I can already see that, for some reason, Ubuntu does not see my swap partition of 512mb, don't know if i should worry with 1gb ram. will look into this.
 
Old 07-08-2008, 07:19 AM   #4
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Original Poster
Rep: Reputation: 38
I have enabled swap and although none of it is used by the system, TOP shows its presence now but still 0 kb in use. what i did notice was that there was only 13mb of 1Gb RAM left, when swap was turned off. Now with swap enabled, there is around 300mb free RAM, and the system seems better now. I do need to do some more testing, i will watch a movie and see what happens.
 
Old 07-08-2008, 07:33 AM   #5
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I think you are on the right path. My system has 1 GB RAM. Soon after starting Linux the swap file always has about 400 MB used. My system seems to reach a steady state with 13 MB RAM free. This is caused by Linux preallocating RAM for cache. (In this respect it is similar to Windows NT and higher Windows operating systems.) My point is that memory preallocation makes it difficult to determine the real memory requirement of the workload being run on the computer.

My system has a 1 GB swap partition. You may benefit by expanding your swap partition to this size. If you don't want to reorganize your disk partitions you can add a container file to an existing partition. If you do this then make the new swap space the same size as your existing swap partition. IMO swap spaces should be the same size. Let me know if you want more information about how to implement this.

Last edited by stress_junkie; 07-08-2008 at 07:41 AM.
 
Old 07-09-2008, 05:28 PM   #6
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Original Poster
Rep: Reputation: 38
My swap space/partition is 512mb. changing the size of this partition will indeed give me a bit of extra work but doable and that would also be the way i'd prefer it. for now i will see how it goes with only half a gb. at this stage still haven't had time to watch a movie (work, work, work) but i have seen a few things through TOP: when starting apps the amount of used ram increases (of course), i have loaded a whole heap of apps simultaneously to see whether the system would freeze again but no such 'luck' so far. I can see how RAM gets full to a point where the system starts allocating swap space, but then when i close down the apps the system does not seem to let go of the used RAM and swap. possibly the system keeps it allocated in case i change my mind and want to run the apps again and they will start quicker during the same session.

will keep you informed of my findings, thanks so far for your help stress junkie, have to go to work now.
 
Old 07-10-2008, 06:33 AM   #7
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
Hello,
SWAP is there "in case of", but if your system begin to use it, well, take a coffee and come back... What I mean is that, a "normal" system under "normal" use NEVER use swap: I have 2gigs of RAM and I make sometimes big scientific calculations on large amount of data, and then (and only then) my system swap, just to prevent crash.
One last word about swap partition size, do you remember the "take twice your RAM size for swap size" rule? I'm (far) not sure, but I think that this rule is to simplify (and then increase speed) the memory translation process, so (again verify what I'm saying) don't estimate the swap size by your possible needs... Maybe some virtual memory gurus could give some enlightment there?
 
Old 07-10-2008, 09:24 AM   #8
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Original Poster
Rep: Reputation: 38
to jf.argentino, i have heard of that rule but nowadays pc's are equipped with lots of RAM and in your case you would need 5gb of swap. (i thought the rule was 2,5 times the RAM) to me that sounds a little bit over the top so i would say that this rule is from the days that pc's did not have that much RAM, but that is just my opinion i am not an expert at all. another reason for me having only 512mb swap is because that seems to be recommended maximum by some distro's (although zenwalk installer recommends 1gb).


To stress junkie, it would be handy if i could place a screen dump of TOP here, i made about 5 of them. each with different readings, this one was taken at a time my system became sluggish:

Cpu(s):6.0%us, 1.0%sy, 0.0%ni, 0.0%id, 93.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1025832k total, 1007104k used, 18728k free, 1644k buffers
Swap: 522104k total, 38660k used, 483444k free, 540904k cached

this is after i started limewire. i also had running: this (firefox 3), thunderbird, terminal with TOP, skype, kopete, ksnapshot. what i particularly notice here is where it says '93.0%wa'. where as in all other cases i took snapshots the cpu was mostly idle, even after starting several apps. limewire seems to push limits.



0 stopped, 1 zombie
Cpu(s): 9.7%us, 1.0%sy, 0.0%ni, 89.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1025832k total, 939708k used, 86124k free, 4400k buffers
Swap: 522104k total, 38660k used, 483444k free, 555096k cached

i find it hard to copy these lines in here as TOP constantly refreshes and 'un selects' the text i just selected, but this was a snapshot with limewire not running. in this scenario a lot of RAM is in use but the system remains responsive. btw, what is a 'zombie' ? it seems that i have 1 zombie. also noticed that when the system has just booted the amount of used ram is around 600mb (!) and under zenwalk about half that.

i just watched about half an hour of movie and the system did not lock so i would like to conclude that now with swap enabled the system is much more stable. time will tell. i would like to know your opinion about these TOP outputs, if i may. Thanks for your time.

Last edited by wabbalee; 07-10-2008 at 09:26 AM.
 
Old 07-16-2008, 06:15 PM   #9
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Original Poster
Rep: Reputation: 38
Now, some time later I have been using my system as normal and it still freezes occasionally, albeit not so often it still occurs. At this stage I am not sure what to do or where to look. it just happened again (twice) and in 'TOP' i could see that the cpu was '99,7%wa', and later it was '74.5%wa'. i could not see which application caused this ad i don't know what 'wa' stands for (perhaps 'waiting'?) mostly in 'TOP' this number is '98.7%id' and i think 'id' stands for 'idle' and then the system is very responsive.

has anyone any ideas?

thanks
 
Old 07-16-2008, 06:28 PM   #10
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
You can check whether swap is part of the problem by printing the swap statistics just after one of your freezing problems occurs. The command is:

sudo swapon -s

You are looking to see if swap utilization > 0%

---------------
Steve Stites
 
Old 07-16-2008, 08:34 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by wabbalee View Post
... and in 'TOP' i could see that the cpu was '99,7%wa', and later it was '74.5%wa'. i could not see which application caused this ad i don't know what 'wa' stands for (perhaps 'waiting'?)
You've got I/O problems - that's waiting for I/O (i.e. disk) completion.
If you're on only one disk, (actual) swapping will compete, and make things worse not better. Try this, it'll show you all the tasks in disk wait
Code:
top -b -n 1 | awk '{if (NR <=7) print; else if ($8 == "D") {print; count++} } END {print "Total status D: "count}'
 
Old 07-17-2008, 11:48 AM   #12
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Original Poster
Rep: Reputation: 38
Thank you jailbait and syg00,

i have done both commands after waiting for a lock up and these are their outputs:



ron@klappy:~$ sudo swapon -s
[sudo] password for ron:
Filename Type Size Used Priority
/dev/sda3 partition 522104 39820 -1

ron@klappy:~$ top -b -n 1 | awk '{if (NR <=7) print; else if ($8 == "D") {print; count++} } END {print "Total status D: "count}'
top - 02:33:53 up 4:36, 1 user, load average: 0.02, 0.08, 0.15
Tasks: 109 total, 2 running, 106 sleeping, 0 stopped, 1 zombie
Cpu(s): 5.0%us, 0.9%sy, 0.0%ni, 88.3%id, 5.7%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1025832k total, 1009148k used, 16684k free, 6000k buffers
Swap: 522104k total, 39820k used, 482284k free, 644356k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5697 root 20 0 3420 1156 1004 D 0.0 0.1 0:03.88 hald-addon-stor
Total status D: 1




i can see there is 39Mb in swap and this number hasn't changed throughout this session.
i can also see that 1Gb of RAM is full, i thought 1 Gb would be enough to run ubuntu.

can anything be done to leave some ram available and swap left untouched?

thank you.
 
Old 07-17-2008, 04:13 PM   #13
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by wabbalee View Post

can anything be done to leave some ram available and swap left untouched?
This is subject to the law of supply and demand. If you use more memory than you have RAM you will page to and from the swap file. If you use less memory than you have RAM then you will not page and thus not do swap I/O. So the solutions are to buy more RAM or to use less memory.

Here are some ways to use less memory:

Fix memory leaks - Some programs don't free up all of their memory when they no longer need it. Over time memory fills up with dead spaces which no program is using. This is a bug. Fix it or report it.

Run fewer programs - No matter how much RAM you have it is possible to fill up your machine with more programs running simultaneously than you have RAM to accommodate. Shift some of the programs to running at off peak times.

Run smaller versions of the same application - Use abiword instead of the OpenOffice word processor. Use a smaller desktop or even drop down to the command line only. Whatever your biggest application programs are see if you can find smaller versions.

Check your cron entries - Maybe you can schedule some of your automatic workload to non-peak times.

-----------------
Steve Stites

Last edited by jailbait; 07-17-2008 at 04:16 PM.
 
Old 07-17-2008, 07:30 PM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Those displays are basically useless in that they don't show the (a) problem - we need to see data when the %wa is "off the dial". For real analysis you'll need some history - sar is the obvious candidate, or run what I suggested in a timed loop in batch writing to a file. Works o.k.

As for your memory, everything (at that time) was fine. A small use of swap over time is fine. Only if you are really storage constrained and are doing truckloads of I/O at the same time as heaps of swapping will you have an issue (with swap).
No evidence of that. Most of your usage is cache - this is (normally) goodness.
 
Old 07-17-2008, 07:49 PM   #15
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Original Poster
Rep: Reputation: 38
Quote:
Originally Posted by jailbait View Post
Fix memory leaks - Some programs don't free up all of their memory when they no longer need it. Over time memory fills up with dead spaces which no program is using. This is a bug. Fix it or report it.
i find this interesting as most programs that i start and stop (i.e. thunderbird, firefox and yes, open office) will of course take up space in RAM and after i am finished with them and when i check in '(h)top' i can still see that the amount of used RAM has not gone down, unlike i would expect. i was under the assumption that the OS does this to make these programs start quicker next time i want to use them during the same session. i would also expect the OS to release this as other programs get started and need the RAM rather then assigning more RAM (and even SWAP), but it seems not to do this. or at least not immediately.

if this is a bug how do i go by fixing and/or reporting this? and to who? firefox? thunderbird? OOO? or Ubuntu?

Quote:
Originally Posted by jailbait View Post
Run fewer programs - No matter how much RAM you have it is possible to fill up your machine with more programs running simultaneously than you have RAM to accommodate. Shift some of the programs to running at off peak times.
i do not know what a Ubuntu system loads during start up but before i have anything else running and x has finished starting, it already occupies about half a Gb of RAM, where as zenwalk sits at 300 to 330 Mb at that stage.

Quote:
Originally Posted by jailbait View Post
Run smaller versions of the same application - Use abiword instead of the OpenOffice word processor. Use a smaller desktop or even drop down to the command line only. Whatever your biggest application programs are see if you can find smaller versions.
but then the next question arises with regards to jailbait's suggestion to use smaller versions of applications; i have lock ups in Zenwalk as well, running XFCE against top heavy KUBUNTU. Zenwalk is known to be a very light distro.

the hardest thing i find is determining where the problem comes from as it happens randomly, no matter what application i am in. it is likely to occur more often when i am running more programs, but it is not completely gone if i do only one thing. also noticed that multitasking can trigger this; iow everything seems to work fine until the moment i want to switch task and it does not respond directly to my mouse click.

i am sorry if this is becoming a long story, but i appreciate and am grateful for the fact that there are people here that are willing to share their knowledge, experience and not to forget time and unconditional effort put in. thanks again.

ron
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: XEN On An Ubuntu Hardy Heron (8.04) Server System (amd64) - High Performance LXer Syndicated Linux News 0 06-06-2008 07:30 AM
Fedora locks up for sure and randomly after x11 update Lsatenstein Fedora 2 12-01-2006 03:00 AM
System locks up randomly, and sometimes fails to boot Likosin Linux - Hardware 2 01-30-2006 06:07 AM
Machine randomly shuts off/locks up - how to track down? BrianK Linux - General 4 10-28-2004 03:53 PM
X locks up randomly !!! anybody ....please help thejedi1 Linux - General 7 04-10-2002 02:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration