Kubuntu 18.10 Xorg severe memory leak

Bug #1815693 reported by Nenad Antic
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
xorg-server (Ubuntu)
Won't Fix
Undecided
Unassigned
xserver-xorg-video-vmware (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Suddenly sometimes during the past two weeks my kubuntu installation has started to freeze up. I can't remember what apt upgrade that caused it, and I have done several the last few days hoping for it to be resolved.

I didn't know what was causing it as I hadn't made any other changes expect for the odd apt upgrade. Before that I had just finished a several weeks long session of intense work around the clock without having to reboot even once. Suddenly it is now freezing up within hours. Even without doing anything, just leaving the computer alone. However, yesterday I accidentally discovered that my RAM was filled up. More than filled up, even all swap was full. And before I could close anything down it froze up again.

So TLDR; I have today logged the memory consumption while I was handling some bills and linked is a log of constantly increasing Xorg memory usage. So it goes until it chokes the machine and only a hard reboot is possible.

My installed RAM is 10GB. Swap is 6GB. Please refer to the linked file to see how the Xorg usage creeps up.
https://www.dropbox.com/s/nf1ev2dxdlc6gqw/xorg_leak.log?dl=0

I should add that this bug seems specific to Kubuntu, and (I guess) associated with running under Virtualbox. I have another Ubuntu 18.04 (i.e. not _K_ubuntu) running on bare metal and it is not having any problems.

Please advise what additional information I should post to have this resolved.

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: xorg 1:7.7+19ubuntu8
ProcVersionSignature: Ubuntu 4.18.0-15.16-generic 4.18.20
Uname: Linux 4.18.0-15-generic x86_64
ApportVersion: 2.20.10-0ubuntu13.2
Architecture: amd64
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: None
CurrentDesktop: KDE
Date: Wed Feb 13 01:00:13 2019
DistUpgraded: 2019-02-09 11:54:01,040 ERROR got error from PostInstallScript ./xorg_fix_proprietary.py (g-exec-error-quark: Failed to execute child process “./xorg_fix_proprietary.py” (No such file or directory) (8))
DistroCodename: cosmic
DistroVariant: ubuntu
ExtraDebuggingInterest: Yes
GraphicsCard:
 VMware SVGA II Adapter [15ad:0405] (prog-if 00 [VGA controller])
   Subsystem: VMware SVGA II Adapter [15ad:0405]
InstallationDate: Installed on 2015-10-22 (1209 days ago)
InstallationMedia: Kubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
Lsusb:
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 002 Device 003: ID 80ee:0021 VirtualBox USB Tablet
 Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: innotek GmbH VirtualBox
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.18.0-15-generic root=UUID=8959cd47-b52f-4a6e-97bb-5d509e3c2480 ro quiet splash
Renderer: Software
SourcePackage: xorg
UpgradeStatus: Upgraded to cosmic on 2019-02-09 (3 days ago)
dmi.bios.date: 12/01/2006
dmi.bios.vendor: innotek GmbH
dmi.bios.version: VirtualBox
dmi.board.name: VirtualBox
dmi.board.vendor: Oracle Corporation
dmi.board.version: 1.2
dmi.chassis.type: 1
dmi.chassis.vendor: Oracle Corporation
dmi.modalias: dmi:bvninnotekGmbH:bvrVirtualBox:bd12/01/2006:svninnotekGmbH:pnVirtualBox:pvr1.2:rvnOracleCorporation:rnVirtualBox:rvr1.2:cvnOracleCorporation:ct1:cvr:
dmi.product.family: Virtual Machine
dmi.product.name: VirtualBox
dmi.product.version: 1.2
dmi.sys.vendor: innotek GmbH
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.95-1
version.libgl1-mesa-dri: libgl1-mesa-dri 18.2.2-0ubuntu1
version.libgl1-mesa-glx: libgl1-mesa-glx 18.2.2-0ubuntu1
version.xserver-xorg-core: xserver-xorg-core 2:1.20.1-3ubuntu2.1
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.10.6-1
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:18.1.0-1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20171229-1ubuntu1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.15-3

Revision history for this message
Nenad Antic (ubuntu-ore) wrote :
Nenad Antic (ubuntu-ore)
description: updated
Revision history for this message
Nenad Antic (ubuntu-ore) wrote :
Nenad Antic (ubuntu-ore)
description: updated
Nenad Antic (ubuntu-ore)
description: updated
Revision history for this message
Nenad Antic (ubuntu-ore) wrote :
Revision history for this message
Nenad Antic (ubuntu-ore) wrote :
Revision history for this message
Nenad Antic (ubuntu-ore) wrote :
Revision history for this message
Nenad Antic (ubuntu-ore) wrote :

According to this stackexchange thread

https://unix.stackexchange.com/questions/36450/how-can-i-find-a-memory-leak-of-a-running-process/282944
Here is almost guarantee steps to find who is leaking the memory

the dumps just posted should have enough information to be able to find the leaking code sections in Xorg.

affects: xorg (Ubuntu) → xorg-server (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xorg-server (Ubuntu):
status: New → Confirmed
Changed in xserver-xorg-video-vmware (Ubuntu):
status: New → Confirmed
Revision history for this message
Jonas (joney) wrote :

I might have found the same or a similar problem and a simple way to reproduce this issue using glxgears. This works even on some real hardware systems (depending on the graphics driver which is used).

export GALLIUM_DRIVER="llvmpipe"
export LIBGL_ALWAYS_SOFTWARE="true"
glxgears -info

When glxgears is using llvmpipe or softpipe as renderer, it should be reproducible. Just grab a corner of the glxgears window and quickly move it around while watching Xorg memory (e.g. with "top -p $(pgrep Xorg)") which should quickly start to grow. In my VirtualBox and vSphere systems, llvmpipe was used by default, so the exports are not necessary and the problem always occurs.

As a workaround for VirtualBox, you can try to enable 3D-acceleration (VM settings -> Display -> Screen). For me, the Xorg memory stayed constant when 3D acceleration was activated (unless I forced the software rendering for glxgears).

To me this looks like a problem in Mesa as I have seen the same behavior on Ubuntu 18.04 (with stock Mesa 18.2.2 and also using the Ubuntu-X team PPA with Mesa 18.3.3), Fedora 29 and Debian 9.

Revision history for this message
Jonas (joney) wrote :

I also opened a bug report for Mesa (https://bugs.freedesktop.org/show_bug.cgi?id=109958) as the glxgears problem occurs on different distributions, not just (K)ubuntu.

Revision history for this message
Nenad Antic (ubuntu-ore) wrote :

Thank you for the suggestion.
I tried enabling 3D-acceleration.
But there is no difference.

Revision history for this message
Elton (ebielton) wrote :

This bug also affects me. My computer has an AMD R9 280x GPU, a 16 gigs RAM, as well as a Core i7 processor. The memory allocated to Xorg triples and sometimes takes up all the available RAM when switching from themes, as from a dark theme to a light theme for instance. Kubuntu 18.10 with backports ppa is enabled and installed on the computer.

Revision history for this message
Elton (ebielton) wrote :

It's unlikely that its a bug affecting the current distributions of Mesa, as I compile and install newer versions of Mesa every day from the Obilaf ppa.

Revision history for this message
Diego Droghini (buckler) wrote :

Hi everyone,
  I encountered the same problem after updating from kubuntu 17.10 to kubuntu 18.04 (no virtual box).
Infact after the update, checking the xorg virtual size memory with 'ps aux', i can see that it keeps growing. Even using the 'free' command the buff/cache field continues to grow.
Even when booting directly from a USB stick (before installation) with kubuntu18.04 the problem persists.

Revision history for this message
Tad (tad-rave) wrote :

Hello,

I have had this problem for ~ 2 months now. I reboot the system at the end of the day and leave it at the Plasma login. Next morning is an oom event.

Mar 26 04:40:43 ignatz3 kernel: Out of memory: Kill process 1364 (Xorg) score 31 or sacrifice child

Mar 26 04:40:43 ignatz3 kernel: oom_reaper: reaped process 1364 (Xorg), now anon-rss:0kB, file-rss:9660kB, shmem-rss:299700kB

Linux ignatz3 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

plasmashell 5.12.7

Qt: 5.9.5
KDE Frameworks: 5.44.0
kf5-config: 1.0

Let me know what other logs I can provide.

Thanks,

Revision history for this message
Nenad Antic (ubuntu-ore) wrote :

Yesterday I upgraded to Ubuntu 19.04 and this issue seems to finally be resolved for the configuration I described in the initial report.

Maybe others reporting here should check theirs with 19.04 as well.

Revision history for this message
David Matějček (dmatej) wrote :

I'm still having issues with Xorg memory consumption on 19.04.
- it is somehow connected with sleep/wakeup of the system
- it is same for nvidia and intel graphic
- it is same whenever I call pm-suspend or close the lid
- uptime does not matter

Nearly every wakeup memory goes from around 150 MB to 300 MB then to 1200, 1800, 3 GB and more. When the system is low on free memory, it goes little bit back to 2 GB.

I'm using Kubuntu 19.04 on Dell 5587 wth 32 GB RAM.

Maybe ... https://bugreports.qt.io/browse/QTBUG-69429

... uptime does not matter because I'm not opening and closing applications, the set is always the same - Eclipse, Firefox, Chromium, Chrome, Thunderbird, Konsole.

Current result of nvidia-smi:

Tue Jul 9 18:37:46 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.56 Driver Version: 418.56 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 106... Off | 00000000:01:00.0 Off | N/A |
| N/A 65C P0 30W / N/A | 5852MiB / 6078MiB | 7% Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1481 G /usr/lib/xorg/Xorg 5051MiB |
| 0 1987 G /usr/bin/kwin_x11 284MiB |
| 0 1992 G /usr/bin/krunner 1MiB |
| 0 1994 G /usr/bin/plasmashell 146MiB |
| 0 2083 G /usr/bin/krusader 2MiB |
| 0 2172 G /usr/bin/amarok 6MiB |
| 0 2787 G /usr/bin/systemmonitor 2MiB |
| 0 3807 G ...quest-channel-token=1811997003997927731 327MiB |
| 0 8783 G /usr/lib/firefox/firefox 1MiB |
| 0 8907 G /usr/lib/firefox/firefox 1MiB |
| 0 8927 G /usr/lib/firefox/firefox 1MiB |
| 0 8954 G /usr/lib/firefox/firefox 1MiB |
| 0 9039 G /usr/lib/firefox/firefox 1MiB |
| 0 9066 G /usr/lib/firefox/firefox 1MiB |
+-----------------------------------------------------------------------------+

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for reporting this bug to Ubuntu.
Ubuntu 18.10 (cosmic) reached end-of-life on July 18, 2019.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it any more. But if you are then please upgrade to the latest Ubuntu version and re-test. If you then find the bug is still present in the newer Ubuntu version, please add a comment here telling us which new version it is in and change the bug status to Confirmed.

Changed in xorg-server (Ubuntu):
status: Confirmed → Won't Fix
Changed in xserver-xorg-video-vmware (Ubuntu):
status: Confirmed → Won't Fix
Revision history for this message
Mats Kindahl (mkindahl) wrote :

I have crashes from OOM reaper for Kubuntu 19.04:

$ lsb_release --all
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco

$ dmesg
[178002.878843] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.slice/sddm.service,task=Xorg,pid=971,uid=0
[178002.878847] Out of memory: Kill process 971 (Xorg) score 404 or sacrifice child
[178002.878856] Killed process 971 (Xorg) total-vm:8349888kB, anon-rss:75244kB, file-rss:0kB, shmem-rss:7256484kB
[178002.882187] oom_reaper: reaped process 971 (Xorg), now anon-rss:0kB, file-rss:0kB, shmem-rss:7256484kB

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.