Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
X using too much memory?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Quok
n00b
n00b


Joined: 29 May 2002
Posts: 1
Location: Kansas, USA

PostPosted: Thu Dec 05, 2002 12:51 am    Post subject: X using too much memory? Reply with quote

I was just wondering how much memory X is using on other people's machines; it seems to be using WAY too much memory here, even after shutting down X and restarting it, or rebooting entirely. Currently, my machine has been up for 3 days, and here's the output of `ps aux | grep X`
root 962 0.0 3.0 323824 23816 ? S Dec01 4:22 /usr/X11R6/bin/X -auth /var/run/xauth/A:0-NaHLGB

the 2 numbers after the 3.0 (SIZE and RSS) are what I'm interested. 23.8M of RSS seems reasonable, but what's up with the 323M under SIZE?? I'm running X 4.2.1 and KDE 3.1 RC2 with the closed-source Nvidia drivers. Machine specs are: Athlon XP 1700+, 768MB RAM, 120GB HD.

I've seen similar issues with X on Gentoo boxes at work, also running Athlon chips, 256 - 512MB RAM, KDE 3.x, and X 4.2 and 4.2.1.

Anyone have any ideas?
Back to top
View user's profile Send private message
JeroenV
Guru
Guru


Joined: 16 Jul 2002
Posts: 447
Location: Amsterdam / Hamburg

PostPosted: Thu Dec 05, 2002 1:19 am    Post subject: Reply with quote

I'm experiencing the same here :(
I haven't really investigated this matter, but have some ideas:

    1) closing some programs frees also X memory => so it's not X's fault? Or partly?
    2) memleak in one or more programs that run under X? (so even closing that program will leave some X mem occupied)
    3) I have many fonts installed... do large fonts (e.g. chinese) take up X memory? (I do notice heavy system load when using a chinese font for the first time...) If yes, are they freed after some time inactive?


Maybe some X-expert can verify/explain the above :?:
Thanks :!:
_________________
Cheers 8)
Jeroen
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
May The Source be with you!
Back to top
View user's profile Send private message
MBCook
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jul 2002
Posts: 136
Location: Insanity, USA

PostPosted: Thu Dec 05, 2002 2:54 am    Post subject: Reply with quote

I'm not at my box, but I think that it's shared memory. Things like the shared graphics card memory, framebuffer, paged out data, etc. Can anyone confirm any of this?
_________________
-- Michael

Read an intelligent book like "The New Thought Police" or "The War Against Boys", and learn the TRUTH.
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Thu Dec 05, 2002 3:11 am    Post subject: Reply with quote

MBCook wrote:
I'm not at my box, but I think that it's shared memory. Things like the shared graphics card memory, framebuffer, paged out data, etc. Can anyone confirm any of this?

Most likely correct.

Also, remember that shared memory is used between several applications. If you are running KDE or Gnome, part of that memory is used by them too.

When that is said, I find it fairly high. I have never seen my X at work get that high, and I run a lot of different programs under KDE. I have also set off 65MB for my video card, it uses regular memory for some reason, stupid Dell box :?

Check which programs use shared memory with ipcs -a

Erik
Back to top
View user's profile Send private message
frogger
n00b
n00b


Joined: 05 Dec 2002
Posts: 35

PostPosted: Thu Dec 05, 2002 4:41 am    Post subject: Reply with quote

X tends to grab a lot of memory if you have it available (e.g. other programs aren't using it). I believe video memory is also included in the memory listing for X.

However, this memory should be freed as necessary if it is required by other applications.

Here is my output of ps aux:
root 25812 1.0 2.9 288368 15060 ? S 15:35 4:54 X :0

I believe RSS (the 15060 number) is a better indication of how much memory is ACTUALLY being used by X, as opposed to VSZ (288368), which includes all the cache, etc.
Back to top
View user's profile Send private message
JeroenV
Guru
Guru


Joined: 16 Jul 2002
Posts: 447
Location: Amsterdam / Hamburg

PostPosted: Thu Dec 05, 2002 9:34 am    Post subject: Reply with quote

Hm, the numbers just don't match :?
Check this out:
Code:
T=0; for n in `ipcs -a | awk '{ print $5 }' | grep [0-9]`; do T=`expr $T + $n`; done; echo $T
8684072

That should mean about 9M of shared mem used alltogether :?:
Now:
Code:

$ top  (sorted by mem usage):
 1660 root      15   0  317M 137M 50596 R     2.3 27.3 207:26 X
 8006 jeroen    15   0 80184  71M 15960 S     0.3 14.1  13:11 mozilla-bin
 4787 jeroen    15   0 39156  11M  8952 S     0.0  2.2   1:47 licq
21813 jeroen    15   0  5224 5224  3900 S     0.0  1.0   0:00 sylpheed
 1746 jeroen    15   0  6132 3952  2160 S     0.1  0.7  10:09 enlightenment
 4251 jeroen    15   0  4876 3936  3068 S     0.0  0.7   0:03 gvim
32029 jeroen    15   0  4816 3604  2868 S     0.0  0.6   0:17 gkrellm
 4802 jeroen    15   0 30224 3316  3004 S     0.0  0.6   0:07 kdeinit
11984 jeroen    15   0  2708 2412  2092 S     0.0  0.4   0:01 Eterm
13452 jeroen    15   0  2732 2408  2020 S     0.0  0.4   0:00 Eterm
27602 jeroen    15   0  2852 2404  2208 R     0.3  0.4   0:01 Eterm
13667 jeroen    15   0  2768 2344  2012 S     0.0  0.4   0:01 Eterm
12203 jeroen    15   0  2784 2340  2012 S     0.0  0.4   0:02 Eterm
 2002 jeroen    15   0  2860 2332  2116 S     0.0  0.4   0:12 Eterm
 2290 jeroen    15   0  2804 2312  2104 S     0.0  0.4   0:06 Eterm
 4800 jeroen    15   0  3432 2228  2228 S     0.0  0.4   0:00 kdeinit
...

Now, take a look at xosview:
http://jeroen.undonet.com/attic/photos/xosview_mem_usage.png
There, cache is distinguished from buffers and used+shared, and an estimated total for used+shared+swap would be around > 450M :!:

So... :? :?:
_________________
Cheers 8)
Jeroen
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
May The Source be with you!
Back to top
View user's profile Send private message
DArtagnan
l33t
l33t


Joined: 30 Apr 2002
Posts: 942
Location: Israel, Jerusalem

PostPosted: Thu Dec 05, 2002 10:00 am    Post subject: Reply with quote

JeroenV wrote:
Hm, the numbers just don't match :?
Check this out:
Code:
T=0; for n in `ipcs -a | awk '{ print $5 }' | grep [0-9]`; do T=`expr $T + $n`; done; echo $T
8684072

That should mean about 9M of shared mem used alltogether :?:
Now:
Code:

$ top  (sorted by mem usage):
 1660 root      15   0  317M 137M 50596 R     2.3 27.3 207:26 X
 8006 jeroen    15   0 80184  71M 15960 S     0.3 14.1  13:11 mozilla-bin
 4787 jeroen    15   0 39156  11M  8952 S     0.0  2.2   1:47 licq
21813 jeroen    15   0  5224 5224  3900 S     0.0  1.0   0:00 sylpheed
 1746 jeroen    15   0  6132 3952  2160 S     0.1  0.7  10:09 enlightenment
 4251 jeroen    15   0  4876 3936  3068 S     0.0  0.7   0:03 gvim
32029 jeroen    15   0  4816 3604  2868 S     0.0  0.6   0:17 gkrellm
 4802 jeroen    15   0 30224 3316  3004 S     0.0  0.6   0:07 kdeinit
11984 jeroen    15   0  2708 2412  2092 S     0.0  0.4   0:01 Eterm
13452 jeroen    15   0  2732 2408  2020 S     0.0  0.4   0:00 Eterm
27602 jeroen    15   0  2852 2404  2208 R     0.3  0.4   0:01 Eterm
13667 jeroen    15   0  2768 2344  2012 S     0.0  0.4   0:01 Eterm
12203 jeroen    15   0  2784 2340  2012 S     0.0  0.4   0:02 Eterm
 2002 jeroen    15   0  2860 2332  2116 S     0.0  0.4   0:12 Eterm
 2290 jeroen    15   0  2804 2312  2104 S     0.0  0.4   0:06 Eterm
 4800 jeroen    15   0  3432 2228  2228 S     0.0  0.4   0:00 kdeinit
...

Now, take a look at xosview:
http://jeroen.undonet.com/attic/photos/xosview_mem_usage.png
There, cache is distinguished from buffers and used+shared, and an estimated total for used+shared+swap would be around > 450M :!:

So... :? :?:


403 Forbidden
You must supply a local referer to get URL '/attic/photos/xosview_mem_usage.png' from this server.
_________________
All for one and one for All
--

MACPRO machine...
Back to top
View user's profile Send private message
JeroenV
Guru
Guru


Joined: 16 Jul 2002
Posts: 447
Location: Amsterdam / Hamburg

PostPosted: Thu Dec 05, 2002 10:45 am    Post subject: Reply with quote

Eh...:? I tried... apparently it works when you put focus in the location-bar after you get that error and then press enter...
(Is that some sort of protection of my ISP :?: That it will only allow non-local referrers for the toplevel index or something like that:?:)
Anyway, that should do the trick :wink:
_________________
Cheers 8)
Jeroen
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
May The Source be with you!
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Thu Dec 05, 2002 4:29 pm    Post subject: Reply with quote

Older threads 'bout this subject:

XFree use a lot of memory

How much memory does your X take
Back to top
View user's profile Send private message
bobo
n00b
n00b


Joined: 18 Jul 2002
Posts: 10

PostPosted: Tue Dec 17, 2002 11:41 pm    Post subject: Reply with quote

According to top, my X always has a SIZE over 280MB (even with just twm running) but the RSS is generally 10-20MB.

Looking at the maps file for the xfree process (under /proc) it appears that there is 268MB mapped to /dev/nvidia0. I'm pretty convinced that X isn't using vast amounts of real memory, as the total VSZ reported by ps is tons more than my total VM and the RSS is more than my real memory.

Don't worry about it, hopefully smarter folk than I will eventually fix ps and top. I used to understand Linux memory management, but it's all horrible and complicated now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum