LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-31-2010, 04:00 PM   #1
fkasmani
Member
 
Registered: Dec 2007
Posts: 178

Rep: Reputation: 17
Memory usage high


I'm using Linux Mint 8 Helena, and for the past few days have been noticing that I cannot put alot of "load" on my machine - especially when I start virtual box and load the WinXP guest OS from there.
The comp actually slows down SO BADLY, it's as if it's "frozen", and then the application just aborts. It also happens with Firefox.

I took a look at the system info and see that my swap partition is not being used at all. . Is this natural?
(When the attached snapshot was take, there were no apps like firefox or virtualbox running).
Attached Thumbnails
Click image for larger version

Name:	memory usage.png
Views:	23
Size:	34.2 KB
ID:	3235  
 
Old 03-31-2010, 07:12 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
memory: www.linuxatemyram.com
cpu: run 'top' and you tell us what's eating your CPU. mention if there's any time spent in 'wa' or I/O wait.

Yes, using no swap means you have no memory problems whatsoever.

I'm guessing your slowness is due to I/O or something using all your CPU.
 
Old 04-01-2010, 01:22 PM   #3
fkasmani
Member
 
Registered: Dec 2007
Posts: 178

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by AlucardZero View Post
cpu: run 'top' and you tell us what's eating your CPU. mention if there's any time spent in 'wa' or I/O wait.
this is the result of free -m
Code:
total       used       free     shared    buffers     cached
Mem:           874        843         30          0         12         73
-/+ buffers/cache:        757        117
Swap:            0          0          0
and this is the header of 'top'
Code:
top - 12:19:46 up 1 day,  7:49,  2 users,  load average: 0.25, 0.32, 0.30
Tasks: 214 total,   3 running, 206 sleeping,   0 stopped,   5 zombie
Cpu(s):  5.6%us,  3.5%sy,  0.0%ni, 44.8%id, 46.2%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    895628k total,   871528k used,    24100k free,     1232k buffers
Swap:        0k total,        0k used,        0k free,    81904k cached
The highest app seems to constantly be firefox as follows:
Code:
20   0  533m 106m  12m R    6 12.2  24:40.41 firefox
but cpu usage is just about 6%

I didn't quite get the idea of what LinuxAteMyRam.com means, but doesn't it look contrary to my issue?
 
Old 04-01-2010, 08:13 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
You have no memory problems.

You do have an I/O problem. What processes are in state 'D' (uninterruptible sleep)?
 
Old 04-02-2010, 01:16 PM   #5
fkasmani
Member
 
Registered: Dec 2007
Posts: 178

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by AlucardZero View Post
You do have an I/O problem.
I/O problem, OMG, and it's a brand new h/drive with a fresh Linux installation - just about a month old.

Quote:
What processes are in state 'D' (uninterruptible sleep)?
'D' ? what's that and how do I see the processes there?

just when I was (for the first time in life) having a wonderful computing experience (after all the windows life) and this problem comes up
 
Old 04-02-2010, 04:02 PM   #6
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
top, sort by state (you may have to reverse the sort)
 
Old 04-02-2010, 08:57 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,061

Rep: Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672
VBox "fixes" the memory you define for the guest - it is effectively taken away from the host system to use for anything else. Doesn't seem to be a problem for you.
The guest is just a disk file. So if the guest needs to do its own (virtualised) I/O, or needs to page, that all needs to happen in the host. You do have a lot of iowait - try this from a terminal session on the host
Code:
top -b -n 1 | awk '{if (NR <=7) print; else if ($8 == "D") {print; count++} } END {print "Total status D: "count}'
BTW, the reason you aren't using swap is that you don't have any ...

Last edited by syg00; 04-02-2010 at 08:58 PM. Reason: Added BTW
 
Old 04-05-2010, 01:12 PM   #8
fkasmani
Member
 
Registered: Dec 2007
Posts: 178

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by AlucardZero View Post
top, sort by state (you may have to reverse the sort)
I'm sorry, I don't understand?
 
Old 04-05-2010, 01:21 PM   #9
fkasmani
Member
 
Registered: Dec 2007
Posts: 178

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by syg00 View Post
VBox "fixes" the memory you define for the guest - it is effectively taken away from the host system to use for anything else. Doesn't seem to be a problem for you.
In virtualbox, I've given the guest OS no more than 192MB. The total physical RAM on my machine is 1GB.
Quote:
Originally Posted by syg00 View Post
The guest is just a disk file. So if the guest needs to do its own (virtualised) I/O, or needs to page, that all needs to happen in the host. You do have a lot of iowait - try this from a terminal session on the host
Code:
top -b -n 1 | awk '{if (NR <=7) print; else if ($8 == "D") {print; count++} } END {print "Total status D: "count}'
Here's the result:
Code:
top - 12:16:03 up  9:38,  2 users,  load average: 0.62, 0.68, 0.49
Tasks: 202 total,   1 running, 196 sleeping,   0 stopped,   5 zombie
Cpu(s): 31.7%us,  4.9%sy,  0.1%ni, 61.3%id,  1.9%wa,  0.1%hi,  0.1%si,  0.0%st
Mem:    895628k total,   849048k used,    46580k free,    11700k buffers
Swap:        0k total,        0k used,        0k free,    97484k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
Total status D:
BTW, when I ran the code you've given, VirtualBox is off. Should I start it along with the guest OS and then try this code again?
What's iowait?

Quote:
Originally Posted by syg00 View Post
BTW, the reason you aren't using swap is that you don't have any ...
how can that be? gparted shows me 5GB for the swap partition?
 
Old 04-05-2010, 04:47 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,061

Rep: Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672
Quote:
Originally Posted by fkasmani View Post
Should I start it along with the guest OS and then try this code again?
Yes - it will only return anything meaningful if the "%wa is high. This is (generally) tasks waiting on I/O.
Quote:
how can that be? gparted shows me 5GB for the swap partition?
You may have the partition, but you're not using it; probably UUID mismatch. Issue "blkid" and check the swap entry in /etc/fstab.
 
Old 04-06-2010, 04:36 PM   #11
fkasmani
Member
 
Registered: Dec 2007
Posts: 178

Original Poster
Rep: Reputation: 17
Thanks.
Everything was working so well when out-of-the-blue this problem started. Before this proble, I had actually allocated 384MB RAM to WinXP in VirtualBox and it was working so smooth.

Quote:
Originally Posted by syg00 View Post
Yes - it will only return anything meaningful if the "%wa is high. This is (generally) tasks waiting on I/O.
I tried to run this command with firefox running along with virtualbox and WinXP (the guest OS) all active but I just couldn't get WinXP to start with firefox and terminal open as virtualbox just kept crashing and closing down, so I had no alternative but to close down firefox then start WinXP thru VirtualBox and then run the command in terminal, so here's the result:
Code:
top - 07:29:42 up  3:23,  2 users,  load average: 1.52, 1.68, 0.94
Tasks: 206 total,   2 running, 199 sleeping,   0 stopped,   5 zombie
Cpu(s): 25.0%us,  5.2%sy,  0.2%ni, 66.8%id,  2.5%wa,  0.1%hi,  0.1%si,  0.0%st
Mem:    895628k total,   851552k used,    44076k free,     1880k buffers
Swap:        0k total,        0k used,        0k free,    62460k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
   33 root      15  -5     0    0    0 D    0  0.0   0:03.30 kswapd0            
Total status D: 1
Quote:
Originally Posted by syg00 View Post
You may have the partition, but you're not using it; probably UUID mismatch. Issue "blkid" and check the swap entry in /etc/fstab.
Here's the result of blkid:
Code:
/dev/sda1: UUID="3ac9d5dd-3b71-4916-b4fe-7765352ecce7" TYPE="swap" 
/dev/sda2: UUID="701130db-0c1a-4392-bbb6-88ee15dabc61" TYPE="ext4" 
/dev/sda3: LABEL="Data Partit" UUID="7380-295A" TYPE="vfat"
Could the swap not being used issue have been caused by a recent resizing I did of the swap partition?
 
Old 04-06-2010, 05:47 PM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,061

Rep: Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672
Quote:
Originally Posted by fkasmani View Post
Could the swap not being used issue have been caused by a recent resizing I did of the swap partition?
Certainly - the mkswap will change the UUID - as I said, have a look at /etc/fstab fro the swap entry - put the UUID from the blkid in there.
kswapd is the swap daemon - you definitely don't want that in uninteruptible sleep (that's what status D is).
Fix the swap.
 
Old 04-07-2010, 05:04 AM   #13
fkasmani
Member
 
Registered: Dec 2007
Posts: 178

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by syg00 View Post
Certainly - the mkswap will change the UUID - as I said, have a look at /etc/fstab fro the swap entry - put the UUID from the blkid in there.
Here's what's currently in the /etc/fstab
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
UUID=701130db-0c1a-4392-bbb6-88ee15dabc61 / ext4 errors=remount-ro 0 1
UUID=8f2583f6-d0a8-4902-96ad-a426b8da9841 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
and this is the result of the blkid
Code:
/dev/sda1: UUID="3ac9d5dd-3b71-4916-b4fe-7765352ecce7" TYPE="swap" 
/dev/sda2: UUID="701130db-0c1a-4392-bbb6-88ee15dabc61" TYPE="ext4" 
/dev/sda3: LABEL="Data Partit" UUID="7380-295A" TYPE="vfat"
I'm not exactly wure which one of the UUID I need to put from the blkid into the fstab and where.

I'm really a total newbie to linux and am not at all familiar with any of this.

Quote:
Originally Posted by syg00 View Post
kswapd is the swap daemon - you definitely don't want that in uninteruptible sleep (that's what status D is).
Fix the swap.
I don't understand what you mean here.
 
Old 04-07-2010, 05:45 AM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,061

Rep: Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672Reputation: 3672
Code:
UUID=8f2583f6-d0a8-4902-96ad-a426b8da9841 none swap sw 0 0    this line ...
UUID=3ac9d5dd-3b71-4916-b4fe-7765352ecce7 none swap sw 0 0    needs to become this ...
Easiest way to update it is to use a fullscreen editor - presuming gnome, do this from a terminal (you'll get asked for your password)
Code:
sudo gedit /etc/fstab
 
1 members found this post helpful.
Old 04-08-2010, 02:26 PM   #15
fkasmani
Member
 
Registered: Dec 2007
Posts: 178

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by syg00 View Post
Code:
UUID=8f2583f6-d0a8-4902-96ad-a426b8da9841 none swap sw 0 0    this line ...
UUID=3ac9d5dd-3b71-4916-b4fe-7765352ecce7 none swap sw 0 0    needs to become this ...
Easiest way to update it is to use a fullscreen editor - presuming gnome, do this from a terminal (you'll get asked for your password)
Code:
sudo gedit /etc/fstab
Thanks so much, syg00.
I now have firefox running along with WinXP thru VirtualBox. So far all seems OK, and the result of
Code:
top -b -n 1 | awk '{if (NR <=7) print; else if ($8 == "D") {print; count++} } END {print "Total status D: "count}'
is
Code:
top - 13:22:04 up 6 min,  2 users,  load average: 1.43, 1.31, 0.64
Tasks: 202 total,   3 running, 194 sleeping,   0 stopped,   5 zombie
Cpu(s): 29.4%us, 15.7%sy,  2.6%ni, 38.3%id, 13.3%wa,  0.4%hi,  0.2%si,  0.0%st
Mem:    895628k total,   844376k used,    51252k free,    10692k buffers
Swap:  5196988k total,   105668k used,  5091320k free,    94564k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
Total status D:
Thanks so much. You're a Genius
 
  


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
High Memory Usage jbum Slackware 6 04-26-2008 03:46 PM
Memory usage too high duBeN Slackware 2 12-04-2006 07:03 AM
High memory usage Kapriel Debian 6 07-29-2005 12:01 PM
High memory usage? Davus Linux - General 6 11-28-2004 03:33 AM
Memory usage too high glock19 Linux - General 7 06-05-2003 08:05 AM

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

All times are GMT -5. The time now is 06:25 PM.

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