X Server: abused or buggy?

Joel Feiner jafeiner at gmail.com
Tue Dec 9 07:30:56 PST 2008

Lubos Lunak wrote:
> On Tuesday 09 of December 2008, �scar Fuentes wrote:
>> After observing how X used 1.3 GB of RAM, some investigation revealed
>> that certain application (Okular, a document viewer,
>> http://okular.kde.org) was causing this memory consumption. It is
>> creating lots of pixmaps as a way for caching document pages. Opening a
>> pdf file an scrolling through its pages makes X memory usage grow in the
>> hundreds of MB. After Okular is closed, usually X returns the memory to
>> the OS. But not always, sometimes retains some dozens of MB.
>> Is this considered a bug on the X server, or is it being abused by the
>> application?
>  Neither. Pixmaps created by applications are normally stored in the X server, 
> and in this specific case this optimization is a feature and can be 
> configured in Okular's configuration.
>  Moreover I'd assume that you interpret memory usage numbers incorrectly 
> (simply because almost everyone does). I suggest to use the 'xrestop' tool to 
> check how X resources are used by applications and find some good explanation 
> of numbers reported by 'top', 'free' or whatever tool you used. If you can 
> still confirm an unreasonable memory usage afterwards, you can report a bug 
> at http://bugs.kde.org .
Why should it be a KDE bug if the X server is leaking memory?  I used to
have this problem with Firefox back in the X.org 7.1 days.  The VSZ and
RSS of the X server would increase without bound after long usage of
Firefox.  Closing Firefox would only reduce the memory usage by a little
bit.  xrestop revealed that the X server only thought it had a couple of
megs of resources allocated, but the heap size of the X server was still
hundreds of megs.  To me, that's a pretty bad memory leak.

More information about the xorg mailing list