LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-20-2010, 08:29 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
Where is my memory :(


Hello I am running a linux maching on a PC which has 2 GB of RAM Installed.

I run out of memory most of the time so I try to understand where memory goes.

Code:
caracus:/home/apa # free -m
             total       used       free     shared    buffers     cached
Mem:          1914       1839         74          0          8        319
-/+ buffers/cache:       1511        402
Swap:         2062       1955        107

Code:
top - 15:28:52 up 3 days,  7:22,  9 users,  load average: 4.73, 5.60, 6.36
Tasks: 230 total,   4 running, 225 sleeping,   0 stopped,   1 zombie
Cpu(s): 26.5%us, 69.4%sy,  0.0%ni,  4.1%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1959936k total,  1885700k used,    74236k free,     9392k buffers
Swap:  2112508k total,  1999344k used,   113164k free,   338672k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1428 root      20   0 1684m 467m 2872 S    2 24.4  73:19.45 Xorg
18537 apa       20   0  883m 281m  35m S    8 14.7  45:02.24 firefox
 3233 apa       20   0  876m  62m  13m S    0  3.3   4:08.47 thunderbird-bin
32635 apa       20   0  207m  57m  15m S    7  3.0   0:18.99 npviewer.bin
19068 apa       20   0  926m  55m 3508 S    0  2.9   0:23.85 MATLAB
32713 apa       20   0  782m  54m  13m S    0  2.9   0:04.60 java
 3398 apa       20   0  671m  51m 4532 S    0  2.7   0:53.15 konqueror
 3052 apa       20   0  604m  35m  10m S    0  1.8   3:10.46 plasma-desktop
Could you please help me try understand the stats above?
Perhaps then I could be able to blame something that consumes my memory.

Best REgards
Alex
 
Old 05-20-2010, 08:54 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
well.. Xorg and Firefox. Make sure your system is all up to date and restart X, and watch it.

Also, if you don't know, http://www.linuxatemyram.com/
 
1 members found this post helpful.
Old 05-20-2010, 09:44 AM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
Thanks for the web site
 
Old 05-20-2010, 10:32 AM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
That's a good site, I will link to it, because a lot of people ask this question.
 
Old 05-20-2010, 10:33 AM   #5
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
However I do think you have a problem since you're using almost 2GB of swap. Run vmstat 10 and watch the 'so' and 'si' columns - if there are a lot above 0 then you're actively swapping and you definitely have a problem.
 
Old 05-20-2010, 10:43 AM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
I did a google search for +xorg +"memory leak" and of course there are a ton of hits and I don't know how to evaluate which are relevant. The one that looked most relevant was

http://forums.opensuse.org/get-help-...os-11-0-a.html

Quote:
Originally Posted by alaios View Post
Hello I am running a linux maching on a PC which has 2 GB of RAM Installed.
It would take a lot more investigation to find out whether something is really wrong (such as a memory leak) or whether you just are using more memory than you have.

Those stats seem to indicate MATLAB, java, konqueror, plasma-desktop and maybe others are tying down a lot of memory while relatively idle. The swap partition is nearly full, so the kernel is forced to leave anonymous pages of idle tasks in physical ram while either dropping pages of active .so's or even calling the "out of memory killer".

So if those stats indicate all valid use of memory (not leaks) then you need a larger swap partition. Even with that, you would have terrible performance each time you switch to a previously idled task and even worse if too many of those tasks are trying to be active at once. You might also need more physical ram.

If it is a memory leak, the most likely problem is Xorg. But I don't have good advice on how to figure out whether there is a memory leak in Xorg.

Quote:
Originally Posted by H_TeXMeX_H View Post
That's a good site, I will link to it, because a lot of people ask this question.
It's a great site, because lots of people ask the question answered by that site. But this time it is a distraction. This thread is not the usual "linux ate my ram" question at all. This time, something definitely is using too much anonymous memory for healthy operation with just 2GB of ram plus 2GB of swap.

So the answer is not the usual "everything is OK, you just misunderstood the stats". The answer is one of:
1) There is a memory leak that should be found and fixed.
2) You need more swap space
3) You need both more swap space and more physical ram.

Last edited by johnsfine; 05-20-2010 at 10:57 AM.
 
Old 05-20-2010, 11:44 AM   #7
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
To find out if Xorg is leaking, leave it on alone (close firefox and the rest) for a while and check top once in a while to see if RAM usage goes up. If it keeps going up, it is a leak.

I don't see any reason to suspect a leak in Xorg, it could be just a lot of memory intensive processes running, close them all and see if it reduces back to normal.
 
Old 05-20-2010, 12:03 PM   #8
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48
Quote:
Originally Posted by alaios View Post
Hello I am running a linux maching on a PC which has 2 GB of RAM Installed.

I run out of memory most of the time so I try to understand where memory goes.

Code:
top - 15:28:52 up 3 days,  7:22,  9 users,  load average: 4.73, 5.60, 6.36
Tasks: 230 total,   4 running, 225 sleeping,   0 stopped,   1 zombie
Cpu(s): 26.5%us, 69.4%sy,  0.0%ni,  4.1%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1959936k total,  1885700k used,    74236k free,     9392k buffers
Swap:  2112508k total,  1999344k used,   113164k free,   338672k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1428 root      20   0 1684m 467m 2872 S    2 24.4  73:19.45 Xorg
18537 apa       20   0  883m 281m  35m S    8 14.7  45:02.24 firefox
Could you please help me try understand the stats above?
Perhaps then I could be able to blame something that consumes my memory.

Best REgards
Alex
My XORG only eats away 12 % of half a gigabyte.... I run a 1280x1024 screen in 24 bit colour. Semonkey eats 17%.

Code:
 2850 root      20   0 73280  58m 3720 S    2 12.5   1:09.60 X
 2916 jan       20   0 77636  21m 7744 S    0  4.5   0:09.58 artsd
 3076 jan       20   0  198m  79m  23m S    0 17.2   0:34.79 seamonkey-bin
Code:
jan@Beryllium:~$ cat /proc/meminfo
MemTotal:       476712 kB
MemFree:          9300 kB
Buffers:         78608 kB
Cached:         156648 kB
SwapCached:          0 kB
Active:         246548 kB
Inactive:       179076 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       476712 kB
LowFree:          9300 kB
SwapTotal:     1124436 kB
SwapFree:      1124432 kB
Dirty:             216 kB
Writeback:           0 kB
AnonPages:      190392 kB
Mapped:          69640 kB
Slab:            18528 kB
SReclaimable:    11376 kB
SUnreclaim:       7152 kB
PageTables:       1864 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
WritebackTmp:        0 kB
CommitLimit:   1362792 kB
Committed_AS:   439000 kB
VmallocTotal:   540664 kB
VmallocUsed:     12984 kB
VmallocChunk:   527400 kB
DirectMap4k:     15616 kB
DirectMap4M:    475136 kB
 
Old 05-20-2010, 12:46 PM   #9
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by H_TeXMeX_H View Post
To find out if Xorg is leaking, leave it on alone (close firefox and the rest) for a while and check top once in a while to see if RAM usage goes up. If it keeps going up, it is a leak.
That would be wasted effort. A leak in Xorg would mean it leaks memory when some specific kind of activity occurs (of course we start with no clue what specific kind of activity). So if you test it with no activity and nothing leaks, you proved nothing. Anyway without a better measure of "RAM usage" you wouldn't know how to interpret the results even if you had some of whatever activity makes Xorg leak.

Quote:
I don't see any reason to suspect a leak in Xorg
So xorg's VIRT size of 1684m and RES size of 467m don't make you suspect a leak? What do you think caused that?

I don't know enough about Xorg. I don't know enough about all the other idle windows in the OP's system (that weren't mentioned in top). So I'm not trying to say those values indicate a leak, just that they make one suspect a leak.
 
Old 05-20-2010, 01:10 PM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Memory leaks are hard to diagnose and hard to fix, so if you know a better way, say so. Otherwise, I would close all processes except for Xorg and see if the usage goes down, if it does, then it was just those processes. You can also try using a program that you know doesn't leak but uses Xorg.

When I was running Xfce I had exactly that happen, and no matter what I did the RAM usage went up with time (characteristic of a leak). It didn't matter if I left it alone or did something, the leak was still there.

Last edited by H_TeXMeX_H; 05-20-2010 at 01:11 PM.
 
Old 05-20-2010, 03:56 PM   #11
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by alaios View Post
Hello I am running a linux maching on a PC which has 2 GB of RAM Installed.

I run out of memory most of the time so I try to understand where memory goes.

Code:
caracus:/home/apa # free -m
             total       used       free     shared    buffers     cached
Mem:          1914       1839         74          0          8        319
-/+ buffers/cache:       1511        402
Swap:         2062       1955        107

Code:
top - 15:28:52 up 3 days,  7:22,  9 users,  load average: 4.73, 5.60, 6.36
Tasks: 230 total,   4 running, 225 sleeping,   0 stopped,   1 zombie
Cpu(s): 26.5%us, 69.4%sy,  0.0%ni,  4.1%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1959936k total,  1885700k used,    74236k free,     9392k buffers
Swap:  2112508k total,  1999344k used,   113164k free,   338672k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1428 root      20   0 1684m 467m 2872 S    2 24.4  73:19.45 Xorg
18537 apa       20   0  883m 281m  35m S    8 14.7  45:02.24 firefox
 3233 apa       20   0  876m  62m  13m S    0  3.3   4:08.47 thunderbird-bin
32635 apa       20   0  207m  57m  15m S    7  3.0   0:18.99 npviewer.bin
19068 apa       20   0  926m  55m 3508 S    0  2.9   0:23.85 MATLAB
32713 apa       20   0  782m  54m  13m S    0  2.9   0:04.60 java
 3398 apa       20   0  671m  51m 4532 S    0  2.7   0:53.15 konqueror
 3052 apa       20   0  604m  35m  10m S    0  1.8   3:10.46 plasma-desktop
Could you please help me try understand the stats above?
Perhaps then I could be able to blame something that consumes my memory.

Best REgards
Alex
<attitude>
You are running some version of KDE 4? Well, that'll probably be the problem then.
</attitude>
Looking at your numbers, there are several noteworthy features:
  • you have a zombie process; that is doing you no good, but it is probably not doing you appreciable harm.
  • your load average numbers are on the high side; this probably means that your computer is running slowly and is somewhat unresponsive; is this the basic problem, or are you propelled by the intellectual satisfaction of understanding this problem?
  • the big consumers of memory appear to be Xorg and FF; the other stuff that you can see is mostly 'small change'
  • for ff, that level of memory consumption is probably reasonable if you lots of tabs open, if you only have one or two it isn't
  • Xorgs' high level of consumption could be a 'bug' in Xorg itself, or, more likely, something is asking Xorg for services that legitimately cause Xorg to consume lots of memory; my bet is that the latter, is probably more likely and is the only thing that you could do something about easily
  • does this happen soon after a clean boot, or is it only after the PC has been running without a re-boot/logout for a while?

You are probably running the version of KDE that came with SUSE out of the box; if so, ensure that you do not have random repositories enabled and try an upgrade to factory if you dare. If you have any conflicting repos enabled currently, sort that problem out and see where that gets you.
(Hmm, that last link seems to be a thread started by someone called, on that forum, alaios; that repo list looks a bit longer than desirable, but with nothing crazy in it - not the full 'I've used one click install a lot' madness).

Alternatively, try a different GUI; do you still have the same problem?
 
  


Reply



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
pthreads virtual memory usage -- memory is not freed after thread exit minimol Linux - General 2 05-26-2009 01:19 AM
LXer: This week at LWN: Memory part 7: Memory performance tools LXer Syndicated Linux News 0 11-22-2007 08:51 AM
Difference between resident memory,shared memory and virtual memory in system monitor mathimca05 Linux - Newbie 1 11-11-2007 04:05 AM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 04:48 PM
RH 8.0 Mapping Virtual Memory to get access to VMIC Reflective Memory PCI card. Merlin53 Linux - Hardware 0 05-05-2003 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:02 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