On Tue, 9 Apr 2002, Mark Vojkovich wrote:

>Date: Tue, 9 Apr 2002 11:39:45 -0700 (PDT)
>From: Mark Vojkovich <[EMAIL PROTECTED]>
>To: Branden Robinson <[EMAIL PROTECTED]>
>Cc: [EMAIL PROTECTED]
>Content-Type: TEXT/PLAIN; charset=US-ASCII
>List-Id: General X Discussion <xpert.XFree86.Org>
>Subject: Re: canonical answer to the complaints about root-window sized
>    cached pixmaps?
>
>On Tue, 9 Apr 2002, Branden Robinson wrote:
>
>> I get complaints about X's memory consumption all the time from KDE
>> users who have dozens of virtual workspaces, large monitors, and a
>> different image in the root window for each workspace.
>> 
>> Is there a canonical answer to this question that I can give my users?
>> I maintain a FAQ for Debian and I'm happy to add this information to it.
>> 
>
>   The X-Window system is a client-server window system.  The
>memory for pixmap data resides on the server side instead of
>the client side.  If you have 8 1600x1200 32bpp root window images
>that's 61 Megabytes.  It resides in the server instead of the
>client, unless they are shared memory pixmaps, in which case
>it will be counted on both the server and client side.
>
>   Obviously this data has to be stored someplace.  It's not
>like it can just disappear when you're not using it.  I don't
>know why it's so hard for those people to comprehend that.
>If they were stored on the client side instead, people would
>be complaining about KDE memory usage.

I'd like to add to that another frequently reported problem of 
XFree86 consuming a lot of memory.  Many people report X uses 
64Mb+ of memory and can't see any reason why it should.  They 
blame X for being bloated, etc.

Digging into it more however, 99 times out of 100, they are using 
the output of top or procps or similar utility do show how much 
memory XFree86 is consuming.  Unfortunately, the memory reported 
as used in top/ps output is interpreted solely as being system 
RAM and/or swap, and that is very misleading as it is not true.

The memory shown by top, which users are misled into believing is 
memory used up by X, is an amalgamation of the video card's own 
memory, and memory mapped I/O regions, as well as the actual 
memory used by the X server, pixmaps, and various other things.

It is not at all uncommon for a modern 64Mb video card, to have 
X's memory usage appear to be 100Mb or more, when in reality, 
64Mb of that is video RAM, and 16-32Mb possibly mmapped 
registers.

Most developers such as ourselves are aware of this, however most 
end-users are not.

On Linux a user can view the memory map breakdown by logging in
as root and looking at the file:

cat /proc/$(pidof X)/maps

That gives a fairly detailed breakdown of the memory map of the X 
server process, and what actual amount of memory is being used, 
etc.

The exact meaning of the contents of the proc maps file is left 
as an exercise for the curious reader.  ;o)  Reading the kernel 
sources which implement it is about the best manual I know of.

Hope this info is also useful for any FAQ.

TTYL

-- 
Mike A. Harris                  Shipping/mailing address:
OS Systems Engineer             190 Pittsburgh Ave., Sault Ste. Marie,
XFree86 maintainer              Ontario, Canada, P6C 5B3
Red Hat Inc.
http://www.redhat.com           ftp://people.redhat.com/mharris

_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to