Red Hat Bugzilla – Bug 529721
Memory leak in KMS
Last modified: 2009-11-06 12:03:25 EST
Description of problem:
There is a memory leak somewhere in KMS which does not appear if I disable KMS.
Version-Release number of selected component (if applicable):
Boot your system with KMS enabled (tested on ATi and Intel graphics cards). Use Okular for half an hour for reading giant PDF file. Top or KSystemGuard will show that cca 100-200 additional MB were allocated. Now close the Okular. The memory is not freed. If you sum the memory usage of all processes displayed by KSystemGuard or top, you'll see that there is cca 200 MB difference to the actual global memory usage. The longer you use the Okular, the more the difference will be. After the difference crosses the 700 MB (in my case), X session will crash, but the memory won't be freed. The same happens if you manually restart the X.
On the other hand, if you replay this scenario without KMS, you'll see that after short usage of Okular, X memory usage goes up by cca 200 MB, but when you close the Okular, the X memory is freed. The same happens if you restart the X.
Note that in KMS environment, X server memory remained low while using Okular, although global system memory usage raised.
So, my conclusion is that some programs, like Okular, use some X server's features that require extensive memory allocation in the mode-setting code. However, in a non-KMS environment, userspace processes (like X) can free that memory after they don't need it anymore, but if that memory is allocated in kernel space, I believe that userspace processes are not allowed to free that memory anymore, and since no one frees it, it leaks.
General discussion about this bug is also here: http://www.phoronix.com/forums/showthread.php?t=19637
I'm moving this ticket to the X server component. Plymouth isn't involved in this bug.
Would you mind installing xrestop and running
xrestop -b > resources.log
while you work? Then attach resources.log to this bug report once you've seen memory usage go up significantly.
Also useful would be /var/log/Xorg.0.log and /etc/X11/xorg.conf (if applicable)
Created attachment 365436 [details]
Files Ray required
The gzipped tar containts the Xorg.0.log file, xorg.conf file, resources.log after 2 hours of using Okular to read big PDF and after closing that file (memory wasn't freed).
It also contains screenshot of KSystemGuard showing running processes sorted by memory usage. I highlighted the global memory usage as shown by KSysGuard, and I also highlighted the memory usage column so you can see that if you sum the memory usage of these processes, you won't get even near the value shown as the global memory usage.
NOTE: Processes that are not shown in the screenshot don't use more than a 1 MB of memory, and there are cca 30 of them. So you can add cca 30 MB to your sum. Even with it, you'll get cca 350 MB, and global usage is 730 MB. So, where are those 380 MB?
If I let global usage pass 1 GB, X session crashes and restarts, but the memory is not freed. This does not happen in a non-KMS environment.
I've just updated kernel to 184.108.40.206-90
The issue is still not fixed...
Since this bugzilla report was filed, there have been several major updates in various components of the Xorg system, which may have resolved this issue. Users who have experienced this problem are encouraged to upgrade their system to the latest version of their packages. For packages from updates-testing repository you can use command
yum upgrade --enablerepo='*-updates-testing'
Alternatively, you can also try to test whether this bug is reproducible with the upcoming Fedora 12 distribution by downloading LiveMedia of F12 Beta available at http://alt.fedoraproject.org/pub/alt/nightly-composes/ . By using that you get all the latest packages without need to install anything on your computer. For more information on using LiveMedia take a look at https://fedoraproject.org/wiki/FedoraLiveCD .
Please, if you experience this problem on the up-to-date system, let us now in the comment for this bug, or whether the upgraded system works for you.
If you won't be able to reply in one month, I will have to close this bug as INSUFFICIENT_DATA. Thank you.
[This is a bulk message for all open Fedora Rawhide Xorg-related bugs. I'm adding myself to the CC list for each bug, so I'll see any comments you make after this and do my best to make sure every issue gets proper attention.]
Since I've had problems with downloading the nightly compose, I downloaded the Beta from http://download.fedoraproject.org/pub/fedora/linux/releases/test/12-Beta/Live/i686/F12-Beta-i686-Live-KDE.iso and tried it in a live session.
Fortunately, I was unable to recreate this memory leak, so I conclude that this bug might be solved.
I will close this bug here, and if it reoccurs, I will reopen the ticket with more info.
Thank you for fixing that issue.