Memory Usage By X

Joel Feiner jafeiner at
Sun Dec 10 10:34:35 PST 2006

> On Sat, Dec 09, 2006 at 09:34:06PM +0000, Paulo J. Matos wrote:
> >* Probably it can't get more because the rest is
> *>* distributed by the other apps. Worse, all mem and swap seem to be in
> *>* use:
> *>* $ free -m
> *>*             total       used       free     shared    buffers     cached
> *>* Mem:          1011        993         18          0          4         57
> *>* -/+ buffers/cache:        931         79
> *>* Swap:          494        494          0
> *>*
> *>* Why is this? Is there any known leak in 7.1? Is this normal?
> *
> This is an age old point of confusion - Unix-like systems don't
> generally like leving memory free.  Free memory is wasted money - if
> you have the memory, you might as well do something useful with it.
> One obvious thing you can do with it is cache disk reads and write to
> speed up the system.  You have 1GiB of memory and free is showing that
> your kernel has used 931MiB of that for buffer cache.  Your memory is
> not used because of X11 at all.  The kernel is caching data from disk.
> Moreover, the swap is probably consumed because the kernel has chosen
> to swap out applications that you weren't using.  By doing this, it
> could make more room for caching disk access.
> This is all confirmed by your explanation that you left some large
> compilation jobs running over night.  This means all of your user
> applications were idle, and so swapped to disk, and that gcc was
> eading lots and lots of different files that the kernel was caching.
> You're seeing totally normal behavior that's just keeping your system
> running better!
Your point is correct, but in this case, you are wrong.  If you actually
look at the data given, you will see that only 57 MB of RAM is actually
being used as cache.  Most of the rest is being used by applications.  Note
also in his "ps aux" output that X is listed as using 666 MB of RAM and
considerably more virtual memory.  This is NOT right.  It should be using
considerably less, especially if there aren't any applications open.

> Ross Vandegrift
> ross at <>
> "The good Christian should beware of mathematicians, and all those who
> make empty prophecies. The danger already exists that the mathematicians
> have made a covenant with the devil to darken the spirit and to confine
> man in the bonds of Hell."
> 	--St. Augustine, De Genesi ad Litteram, Book II, xviii, 37
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the xorg mailing list