Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 03-19-2006, 11:00 PM   #1
LQ Newbie
Registered: Jan 2006
Location: Missouri
Distribution: Gentoo 2007.0 x86 & amd64
Posts: 25

Rep: Reputation: 15
Question Memory leak in X?

I left my computer on for a few days and was sort of alarmed that there was apparently a memory leak with X. Ksysguard showed X as taking up something like 400MB of physical memory (there was about 900MB of my 2GB RAM actually used, according to free -mt and Gkrellm.) I logged out of KDE, restarted X, and voila- X's RAM usage is down to 38MB and my total RAM usage went down to about 500MB.

I am running SuSE 10.0 64-bit and have Xorg version 6.8.2 as supplied by SuSE. Has anybody else seen this behavior?
Old 03-19-2006, 11:28 PM   #2
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
X shared memory (used by all X applications) is associated with the X server. In other words, that 900MB was cache for all the applications running on X. Because there was no pressure on memory in your case, keeping the storage was a good decision - faster operation for applications.
Old 03-19-2006, 11:50 PM   #3
LQ Guru
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Probably a SUSE bug. I have never experience with Mandrake 9.0, Slackware 10.0, and Gentoo. Memory in Linux is confusing.

At about 7 hours of use X is only using 20 MB of RAM. I used the utility pmap to figure out the true memory consumption for each program that is running. I am using XFce4 as my window manager. When running pmap look for writable/private value when using the detail option.
Old 03-20-2006, 12:30 AM   #4
Gato Azul
Registered: Sep 2003
Location: /dev/null
Distribution: CentOS, Ubuntu
Posts: 128

Rep: Reputation: 16
As macemoneta said, Linux makes extensive use of memory caching, which is a Good Thing™. Caching programs and data in memory can significantly speed up programs as the computer doesn't have to access the hard drive which is quite an order of magnitude slower than memory access times. The result of this caching though often causes concern though in users who aren't aware of how Linux memory management works, but the important thing when looking at memory use is looking at how much of that is cached memory.

Mizzou_Engineer: what was the complete output of free -mt?
Old 03-21-2006, 06:39 AM   #5
LQ Newbie
Registered: Jan 2006
Location: Missouri
Distribution: Gentoo 2007.0 x86 & amd64
Posts: 25

Original Poster
Rep: Reputation: 15
Well, I restarted my computer and after 24h 4m of uptime, the RAM usage is normal for this machine as I have 2 F@H clients running in the background. Free -mt does not show much now as you can see below. But it did say that the used +/- buffers/cache was about 900MB before I restarted, so I'll post it again if the RAM usage gets back up there.

total used free shared buffers cached
Mem: 2004 1950 54 0 160 1224
-/+ buffers/cache: 566 1438
Swap: 2055 0 2055
Total: 4059 1950 2109

Oh, there was a security update to xorg-xserver this morning, so that might help the problem too.

EDIT: I think it is back:
free -mt:
total used free shared buffers cached
Mem: 2004 1955 49 0 109 1003
-/+ buffers/cache: 841 1162
Swap: 2055 3 2051
Total: 4059 1958 2100

And top:
5699 root 15 0 337m 250m 5676 S 9.9 12.5 68:58.43 X

It has only been up for 2d 11h 40m, so it is not quite as big as before, but should X be taking up 250MB of RAM?

Last edited by Mizzou_Engineer; 03-22-2006 at 06:11 PM.
Old 04-15-2010, 07:28 AM   #6
LQ Newbie
Registered: Apr 2010
Posts: 4

Rep: Reputation: 0

The solution proposed in worked for me: disable xinerama.

On ubuntu 9.04 (using an Intel GMA chipset), I added this at the bottom of my /etc/X11/xorg.conf file and then had no more problem after restarting the X server:

Section "Serverflags"
Option "Xinerama" "false"


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
Memory leak?! nyk Programming 10 01-24-2005 07:08 PM
what is memory leak blackzone Programming 6 11-05-2004 10:32 AM
memory leak mfitzpat Linux - Newbie 1 09-24-2004 02:58 PM
Memory Leak don_dimo Linux - General 7 03-06-2004 06:51 PM
Memory Leak when using memory debugging C program on SuSE SLES8 babalina Linux - Distributions 0 10-06-2003 09:39 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:03 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration