LinuxQuestions.org
Review your favorite Linux distribution.
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 10-26-2004, 05:42 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Why is XFree taking so much memory?


Hi, Guys.

After a whole day of work, X is using 151 MB of ram (which is more than half the physical ram I have).

I wonder why that happens.

It's a mandrake 10.
Code:
# lspci
00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev 03)
00:02.0 VGA compatible controller: Intel Corp. 82845G/GL [Brookdale-G] Chipset Integrated Graphics Device (rev 03)
00:1d.0 USB Controller: Intel Corp. 82801DB USB (Hub #1) (rev 02)
00:1d.1 USB Controller: Intel Corp. 82801DB USB (Hub #2) (rev 02)
00:1d.2 USB Controller: Intel Corp. 82801DB USB (Hub #3) (rev 02)
00:1d.7 USB Controller: Intel Corp. 82801DB USB2 (rev 02)
00:1e.0 PCI bridge: Intel Corp. 82801BA/CA/DB/EB PCI Bridge (rev 82)
00:1f.0 ISA bridge: Intel Corp. 82801DB LPC Interface Controller (rev 02)
00:1f.1 IDE interface: Intel Corp. 82801DB Ultra ATA Storage Controller (rev 02)
00:1f.3 SMBus: Intel Corp. 82801DB/DBM SMBus Controller (rev 02)
00:1f.5 Multimedia audio controller: Intel Corp. 82801DB AC'97 Audio Controller (rev 02)
03:0a.0 Ethernet controller: Broadcom Corporation BCM4401 100Base-T (rev 01)

# X -version

This is a pre-release version of XFree86, and is not supported in any
way.  Bugs may be reported to XFree86@XFree86.Org and patches submitted
to fixes@XFree86.Org.  Before reporting bugs in pre-release versions,
please check the latest version in the XFree86 CVS repository
(http://www.XFree86.Org/cvs).

XFree86 Version 4.3.0.1
Release Date: 15 August 2003
X Protocol Version 11, Revision 0, Release 6.6
Build Operating System: Linux 2.6.3-3mdkenterprise i686 [ELF]
Build Date: 24 March 2004
        Before reporting problems, check http://www.XFree86.Org/
        to make sure that you have the latest version.
Module Loader present

# cat /etc/X11/XF86Config-4
# File generated by XFdrake.

# **********************************************************************
# Refer to the XF86Config man page for details about the format of
# this file.
# **********************************************************************

Section "Files"
    # Multiple FontPath entries are allowed (they are concatenated together)
    # By default, Mandrake 6.0 and later now use a font server independent of
    # the X server to render fonts.
    FontPath "unix/:-1"
EndSection

Section "ServerFlags"
    #DontZap # disable <Crtl><Alt><BS> (server abort)
    AllowMouseOpenFail # allows the server to start up even if the mouse doesn't work
    #DontZoom # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
EndSection

Section "Module"
    Load "dbe" # Double-Buffering Extension
    Load "v4l" # Video for Linux
    Load "extmod"
    Load "type1"
    Load "freetype"
    Load "glx" # 3D layer
    Load "dri" # direct rendering
EndSection

Section "DRI"
    Mode 0666
EndSection

Section "InputDevice"
    Identifier "Keyboard1"
    Driver "Keyboard"
    Option "XkbModel" "pc105"
    Option "XkbLayout" "la"
    Option "XkbOptions" ""
EndSection

Section "InputDevice"
    Identifier "Mouse1"
    Driver "mouse"
    Option "Protocol" "IMPS/2"
    Option "Device" "/dev/mouse"
    Option "ZAxisMapping" "4 5"
EndSection

Section "Monitor"
    Identifier "monitor1"
    VendorName "Plug'n Play"
    ModelName "HP 5500 color monitor"
    HorizSync 30-54
    VertRefresh 50-120

    # Sony Vaio C1(X,XS,VE,VN)?
    # 1024x480 @ 85.6 Hz, 48 kHz hsync
    ModeLine "1024x480"    65.00 1024 1032 1176 1344   480  488  494  563 -hsync -vsync

    # TV fullscreen mode or DVD fullscreen output.
    # 768x576 @ 79 Hz, 50 kHz hsync
    ModeLine "768x576"     50.00  768  832  846 1000   576  590  595  630

    # 768x576 @ 100 Hz, 61.6 kHz hsync
    ModeLine "768x576"     63.07  768  800  960 1024   576  578  590  616
EndSection

Section "Device"
    Identifier "device1"
    VendorName "Intel Corporation"
    BoardName "Intel 845"
    Driver "i810"
    Option "DPMS"
EndSection

Section "Screen"
    Identifier "screen1"
    Device "device1"
    Monitor "monitor1"
    DefaultColorDepth 16

    Subsection "Display"
        Depth 8
        Virtual 1024 768
    EndSubsection

    Subsection "Display"
        Depth 15
        Virtual 1024 768
    EndSubsection

    Subsection "Display"
        Depth 16
        Virtual 1024 768
    EndSubsection

    Subsection "Display"
        Depth 24
        Virtual 1024 768
    EndSubsection
EndSection

Section "ServerLayout"
    Identifier "layout1"
    InputDevice "Keyboard1" "CoreKeyboard"
    InputDevice "Mouse1" "CorePointer"
    Screen "screen1"
EndSection
How can I keep X from taking so much memory?
 
Old 10-26-2004, 06:26 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982
where are you looking to find this statistic? remember that Linux uses caching memory, so your RAM WILL fill up of its own accord. this is a good thing. search google for Linux Memory Management
 
Old 10-26-2004, 10:32 PM   #3
haimeltjnfg
Member
 
Registered: May 2004
Distribution: debian
Posts: 235

Rep: Reputation: 30
what nice value does x use?

if you use a 2.6.x, change the nice value to 0
 
Old 10-27-2004, 12:16 AM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
First question:
- Just used top. I use it as a workstation at work. It has 256 MB of ram plus 512 MB swap.... when I'm working I fill up the physical ram and take about 250 mb swap.... that makes my system rather slow in general..... but if I can make X use less ram I guess my system would move a little faster. That's why I want to know how tell it how much ram to take.

Second:
How is the nice value gonna change the amount of memory the process is taking? If I'm not wrong, it will only change the priority of execution of the given task..... and giving it a nice of 0 would make it real-time..... I have better things to do with the CPU machine cycles.
 
Old 10-27-2004, 07:30 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982
you can't say "use less ram" that's daft. you still haven't said what's making you think is using it.... the top contents is presumably using the cahced data too. try running "free" and see what it says there about how much of the "in use" memory is actually down to cache.
 
Old 10-27-2004, 09:07 AM   #6
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Code:
$ free
             total       used       free     shared    buffers     cached
Mem:        247976     246156       1820          0       3692     111776
-/+ buffers/cache:     130688     117288
Swap:       538136       5320     532816
And look at this:
Code:
top - 09:03:05 up 17 min,  1 user,  load average: 0.51, 0.28, 0.20
Tasks:  68 total,   2 running,  65 sleeping,   0 stopped,   1 zombie
Cpu(s): 11.2% us,  1.9% sy,  0.0% ni, 81.6% id,  5.3% wa,  0.1% hi,  0.0% si
Mem:    247976k total,   241748k used,     6228k free,     4672k buffers
Swap:   538136k total,     5392k used,   532744k free,   106660k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1537 root      15   0  147m  15m 135m R  6.0  6.2   0:25.77 X
 2376 antoranz  15   0 59024  16m  55m S  2.0  6.9   0:01.07 kdeinit
    1 root      16   0  1580  516 1424 S  0.0  0.2   0:02.34 init
    2 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
.
.
.
It says X is taking 147 mb of ram right now. I checked in my laptop... and it takes just 25 mb (with 1600x1200 and the same 16-bit color depth).

Last edited by eantoranz; 10-27-2004 at 09:08 AM.
 
Old 10-27-2004, 11:14 AM   #7
NLogN
LQ Newbie
 
Registered: Sep 2004
Distribution: Debian
Posts: 14

Rep: Reputation: 0
the RES column shows the current amount of resident memory - which in your case for X is 15 MB.

here's some documentation Google Cache

3. The difference among VIRT, RES, and SHR in top output
VIRT stands for the virtual size of a process, which is the sum of memory it is actually using, memory it has mapped into itself (for instance the video card's RAM for the X server), files on disk that have been mapped into it (most notably shared libraries), and memory shared with other processes. VIRT represents how much memory the program is able to access at the present moment.

RES stands for the resident size, which is an accurate representation of how much actual physical memory a process is consuming. (This also corresponds directly to the %MEM column.) This will virtually always be less than the VIRT size, since most programs depend on the C library.

SHR indicates how much of the VIRT size is actually sharable (memory or libraries). In the case of libraries, it does not necessarily mean that the entire library is resident. For example, if a program only uses a few functions in a library, the whole library is mapped and will be counted in VIRT and SHR, but only the parts of the library file containing the functions being used will actually be loaded in and be counted under RES.
 
Old 10-27-2004, 11:45 AM   #8
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
I guess from your reply that X is accounting the Video Card's memory in the virt memory.

But that's kind of confusing for me right now. I've spent the morning working just like I normally do. I configured X to use the vesa driver... I have no hardware acceleration, but that's ok.... don't need it to work (just to impress my coworkers with rss screensavers ).... as I was saying.... I've spent the morning normally. This is top output right now:
Code:
top - 11:38:24 up  1:37,  0 users,  load average: 0.16, 0.15, 0.15
Tasks:  85 total,   1 running,  83 sleeping,   0 stopped,   1 zombie
Cpu(s): 10.7% us,  1.0% sy,  0.0% ni, 83.3% id,  4.8% wa,  0.1% hi,  0.0% si
Mem:    247976k total,   245788k used,     2188k free,     2552k buffers
Swap:   538136k total,   182404k used,   355732k free,    83304k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 2935 antoranz  15   0 14380  10m 7252 S  2.0  4.2   0:35.28 wish
 1440 xfs       16   0  6244 2772 2512 S  0.0  1.1   0:00.21 xfs
 1505 daemon    16   0  1616  392 1456 S  0.0  0.2   0:00.00 atd
 1513 root      16   0  2684  416 2504 S  0.0  0.2   0:00.00 mdkkdm
 1542 root      15   0 33604  12m  14m S  0.0  5.3   2:52.87 X
right now It's using 33 mb in virt, right? that would mean that the extra memory it was taking was from the video card memory. That makes sense... but I have noticed that my swap is about 100 MB or so lower than it was using the i810 driver.That makes me think the X server is using memory (not video memory) when It uses i810 driver.
 
Old 10-27-2004, 12:00 PM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982
Code:
$ free
             total       used       free     shared    buffers     cached
Mem:        247976     246156       1820          0       3692     111776
-/+ buffers/cache:     130688     117288
Swap:       538136       5320     532816
from this your system is only using 130688 kb of memory in real terms.
 
Old 10-27-2004, 12:20 PM   #10
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
I think that was taken before I started using the vesa driver.... and before I started working in my computer... I mean I didn't have any of my applications working.... just the graphical "login prompt." This is now:

Code:
$ free
             total       used       free     shared    buffers     cached
Mem:        247976     242504       5472          0       3760      45672
-/+ buffers/cache:     193072      54904
Swap:       538136     205312     332824


anyway.... I think it's getting a little messy. So why don't we start all over again, ok? I'll refrase the problem to see if we can make it clearer:

Until Yesterday I was using the i810 driver for my video card. When My system was working it was using too much memory. I noticed that X was taking too much memory. So I decided to change the video driver and use vesa instead. Since then my system is using 100 mb or so less memory. That makes me think the module is somehow related to the amount of memory my system is using.

So far so good...... now something else:
I want to use the i810 driver... but I don't want the X server to grab those 100 or so mb it was using (in excess???).

(what a mess! )
 
Old 10-27-2004, 12:23 PM   #11
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
I'll switch back to i810, will get the apps working and ask for a "free"... but that will be in a while... I'm gonna have lunch NOW!
 
Old 10-27-2004, 12:56 PM   #12
NLogN
LQ Newbie
 
Registered: Sep 2004
Distribution: Debian
Posts: 14

Rep: Reputation: 0
I found some more information on the i810 driver. It looks like it does use the system memory.

Google Cache

"The i810 has a unified memory architecture and uses system memory for video ram."
 
Old 10-27-2004, 12:59 PM   #13
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Now we're talking. Let me take a look!
 
Old 10-27-2004, 01:05 PM   #14
NLogN
LQ Newbie
 
Registered: Sep 2004
Distribution: Debian
Posts: 14

Rep: Reputation: 0
The i810 is one of those "integrated" graphics chips. So it has to use the system memory - It doesn't have any dedicated. If you'd like to configure how much memory the driver uses I believe you can set it with VideoRam option in your X config file.

--------------
For example:

Section "Device"
Identifier "i810"
VendorName "Intel"
Driver "i810"
VideoRam 32768
EndSection
--------------


Which specifies 32 MB
 
Old 10-27-2004, 01:31 PM   #15
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
I'll give it a try. Will tell you in a couple of minutes.
 
  


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
are the consoles already taking up system memory? DJOtaku Linux - General 5 10-31-2005 04:52 PM
XFree ghost image video memory d_t_baker Linux - Software 1 03-06-2005 01:09 PM
x is taking alot of memory Smokey Slackware 3 02-07-2005 05:07 PM
I wonder why a program I made with streams is taking so much memory eantoranz Programming 5 04-30-2004 08:37 PM
Updating XFree while running XFree? Micro420 Mandriva 7 02-18-2004 02:48 PM

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

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