Bug 104340

Summary: Memory leak with GEM objects
Product: xorg Reporter: S. Gilles <sgilles>
Component: Driver/nouveauAssignee: Nouveau Project <nouveau>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg (up to last nouveau messages)
none
first few lines of /sys/kernel/debug/kmemleak
none
contents of /proc/meminfo after running X for a few weeks, then killing it
none
output of slabtop after running X for a few weeks none

Description S. Gilles 2017-12-19 18:53:31 UTC
Created attachment 136291 [details]
dmesg (up to last nouveau messages)

I have a gk106, current versions of libdrm, mesa, kernel (observed both with -mainline and https://github.com/skeggsb/linux branch linux-4.15 as of a few minutes ago), and there appears to be a memory leak with nouveau that eats up about .5 GB every day. Killing X does nothing.

Attached is output of dmesg from the most recent boot of this machine. I've also attached (in case it matters) dumps of /proc/meminfo and output of slabtop after I ran X for about two weeks, then exited and killed all major daemons.  More importantly, I've attached a few hundred lines of /sys/kernel/debug/kmemleak (from the most recent boot). After the first few entries, they all start looking the same (except for the address and age).
Comment 1 S. Gilles 2017-12-19 18:54:16 UTC
Created attachment 136292 [details]
first few lines of /sys/kernel/debug/kmemleak
Comment 2 S. Gilles 2017-12-19 18:55:18 UTC
Created attachment 136294 [details]
contents of /proc/meminfo after running X for a few weeks, then killing it
Comment 3 S. Gilles 2017-12-19 18:55:46 UTC
Created attachment 136295 [details]
output of slabtop after running X for a few weeks
Comment 4 Ben Skeggs 2017-12-19 22:47:51 UTC
I've pushed a fix for a rather stupid memory leak bug that's likely the cause of what you're seeing.
Comment 5 S. Gilles 2017-12-19 23:29:19 UTC
This appears to fix it. I've been testing the fix for about 30 minutes, and kmemleak is no longer complaining about X.  Thanks for looking into this!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.