LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Memory leak in X? (https://www.linuxquestions.org/questions/linux-software-2/memory-leak-in-x-426455/)

Mizzou_Engineer 03-19-2006 11:00 PM

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?

macemoneta 03-19-2006 11:28 PM

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.

Electro 03-19-2006 11:50 PM

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.

Gato Azul 03-20-2006 12:30 AM

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?

Mizzou_Engineer 03-21-2006 06:39 AM

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?

ert45 04-15-2010 07:28 AM

Hello,

The solution proposed in https://bugs.launchpad.net/ubuntu/+s...er/+bug/186354 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"
Endsection


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