Xorg memory use gradually increases over time, eventually requiring a restart

Bug #1980299 reported by robin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vlc (Ubuntu)
New
Undecided
Unassigned

Bug Description

Over the space of several days, the system becomes more and more sluggish. If I run "top", the memory use of Xorg can be as high as 3GB. The only remedy I know of is to restart Xorg.

From top:
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
   2371 robin 20 0 1655916 1.0g 75224 S 9.6 13.4 8:18.10 Xorg

My system has 8GB of RAM.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: xorg 1:7.7+23ubuntu2
Uname: Linux 5.18.6-051806-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
BootLog: '/var/log/boot.log'
CasperMD5CheckResult: unknown
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: None
CurrentDesktop: GNOME-Flashback:GNOME
Date: Thu Jun 30 12:53:15 2022
DistUpgraded: 2022-04-30 00:12:41,820 DEBUG Running PostInstallScript: '/usr/lib/ubuntu-advantage/upgrade_lts_contract.py'
DistroCodename: jammy
DistroVariant: ubuntu
DkmsStatus:
 acpi-call/1.2.2, 5.15.0-40-generic, x86_64: installedACPI disabled in this kernel, not building module.

 acpi-call/1.2.2, 5.17.9-051709-generic, x86_64: installedACPI disabled in this kernel, not building module.

 acpi-call/1.2.2, 5.18.6-051806-generic, x86_64: installed
ExtraDebuggingInterest: Yes, if not too technical
GraphicsCard:
 Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09) (prog-if 00 [VGA controller])
   Subsystem: Lenovo 3rd Gen Core processor Graphics Controller [17aa:21f3]
InstallationDate: Installed on 2019-05-26 (1130 days ago)
InstallationMedia: Ubuntu 18.04.2 LTS "Bionic Beaver" - Release amd64 (20190210)
MachineType: LENOVO 2347CTO
ProcKernelCmdLine: BOOT_IMAGE=/@/boot/vmlinuz-5.18.6-051806-generic root=UUID=f91098f2-0c4e-4f3d-a40b-a970b8f72e18 ro rootflags=subvol=@ quiet splash vt.handoff=7
SourcePackage: xorg
Symptom: display
UpgradeStatus: Upgraded to jammy on 2022-04-29 (61 days ago)
dmi.bios.date: 05/25/2012
dmi.bios.release: 1.16
dmi.bios.vendor: LENOVO
dmi.bios.version: G1ET41WW (1.16 )
dmi.board.asset.tag: Not Available
dmi.board.name: 2347CTO
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.ec.firmware.release: 1.7
dmi.modalias: dmi:bvnLENOVO:bvrG1ET41WW(1.16):bd05/25/2012:br1.16:efr1.7:svnLENOVO:pn2347CTO:pvrThinkPadT430:rvnLENOVO:rn2347CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:skuLENOVO_MT_2347:
dmi.product.family: ThinkPad T430
dmi.product.name: 2347CTO
dmi.product.sku: LENOVO_MT_2347
dmi.product.version: ThinkPad T430
dmi.sys.vendor: LENOVO
version.compiz: compiz 1:0.9.14.1+22.04.20211217-0ubuntu2
version.libdrm2: libdrm2 2.4.110-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 22.0.1-1ubuntu2.1
version.libgl1-mesa-glx: libgl1-mesa-glx N/A
version.xserver-xorg-core: xserver-xorg-core 2:21.1.3-2ubuntu2
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:19.1.0-2build3
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20210115-1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.17-2build1

Revision history for this message
robin (robinp) wrote :
Revision history for this message
robin (robinp) wrote :
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for the bug report. The leak is likely in an application, since the Xorg process holds all the memory associated with app windows and resources.

Please use 'xrestop' to find out which windows are using the most memory.

affects: xorg (Ubuntu) → ubuntu
Changed in ubuntu:
status: New → Incomplete
Revision history for this message
robin (robinp) wrote :

Hi, thanks for the suggestion. I have run xrestop as suggested, but am not sure what I'm looking for. There are no obvious overly-high memory users, but that's probably more about me not understanding than anything else. See below for a screen grab; for comparison Xorg is currently using 19% of CPU and 22% of Mem.

xrestop - Display: localhost
          Monitoring 53 clients. XErrors: 0
          Pixmaps: 123970K total, Other: 135K total, All: 124106K total

res-base Wins GCs Fnts Pxms Misc Pxm mem Other Total PID Identifier
2200000 18 4 1 23 2548 38690K 61K 38751K 2494 metacity
5600000 1 1 0 4 18 11669K 480B 11670K ? <unknown>
4600000 24 15 1 21 88 11235K 3K 11239K 13531 Firefox
4200000 33 11 1 15 113 9918K 4K 9923K 3264 Thunderbird
6000000 21 12 1 16 71 9694K 3K 9698K 13882 Firefox
4c00000 11 5 1 6 35 9474K 2K 9476K ? Qt Selection Owner for kate
3c00000 9 4 1 35 279 5139K 7K 5147K 7816 nemo
2e00000 5 2 1 3 42 4410K 2K 4412K ? Qt Selection Owner for yakuake
5e00000 0 1 0 1 4 4098K 120B 4098K ? <unknown>
4400000 0 1 0 1 4 4098K 120B 4098K ? <unknown>
3e00000 0 1 0 1 4 4098K 120B 4098K ? <unknown>
4800000 3 0 1 0 17 3889K 1K 3891K ? Chromium clipboard
0c00000 25 4 0 20 549 3545K 13K 3558K 2405 gnome-flashback
6e00000 6 4 0 2 202 1863K 4K 1868K 26773 gnome-power-statistics
0000000 2 0 2 0 206 1024K 6K 1031K ? <unknown>
2600000 0 0 0 1 0 1024K 0B 1024K ? <unknown>
2400000 21 4 1 4 397 95K 10K 106K 2617 Panel
3800000 1 1 1 0 18 0B 1K 1K ? Qt Selection Owner for kglobalaccel5
2c00000 2 1 1 0 10 0B 1K 1K ? Qt Selection Owner for kdeconnectd
6a00000 1 1 1 0 9 0B 1K 1K ? Qt Selection Owner for kind
2000000 4 1 0 0 19 0B 576B 576B 2682 Network Configurator
4a00000 3 1 0 0 17 0B 504B 504B 10043 sd
1200000 3 1 0 0 16 0B 480B 480B 2459 ibus-x11
5800000 2 1 0 0 16 0B 456B 456B 10110
0800000 2 1 0 0 10 0B 312B 312B 2406 gnome-flashback-clipboard
2a00000 1 1 0 0 10 0B 288B 288B 2712 nm-applet
1e00000 2 1 0 0 9 0B 288B 288B 2539 gsd-xsettings
5c00000 1 1 0 0 9 0B 264B 264B 10138 xdg-desktop-portal-gtk
4e00000 1 1 0 0 9 0B 264B 264B 5130 kate
4000000 1 1 0 0 9 0B 264B 264B 2850 update-notifier
3a00000 1 1 0 0 9 0B 264B 264B 2790 kglobalaccel5
3400000 1 1 0 0 9 0B 264B 264B 2690 yakuake

Revision history for this message
robin (robinp) wrote :

The text grab didn't work so well, here's a screenshot to preserve layout.

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

Thanks but that's only 124 MB. Is top (or ps) still reporting a high RES/RSS value for Xorg?

Revision history for this message
robin (robinp) wrote :

Yes, it is.

Revision history for this message
robin (robinp) wrote :

I think I may have found the source, but I'm not at all sure. I tether my Android phone to share the internet connection with my laptop. Each time I plug in the USB cable, a dialogue appears on screen with a message like this:

"Unable to mount Samsung Android
Unable to mount MTP device"003,027""

If I watch xrestop while this happens, the memory use for Metacity goes up by ~300KB each time. Given I only reboot when I get a new kernel (maybe once every 10 days or so), and generally leave my phone plugged in all day (complete with a dodgy plug!), it will show this message multiple times and thus slowly raise the memory used. Closing all the dialogue boxes reduces the xrestop memory value for metacity back to the value it was at before plugging in the phone repeatedly.

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

I noticed metacity is the highest memory user but that's also expected because it's the compositor. And it's only 38 MB apparently.

summary: - Xorg memory use gradually increases over time, eventually requiring a
- restart
+ [GNOME-Flashback] Xorg memory use gradually increases over time,
+ eventually requiring a restart
Changed in ubuntu:
status: Incomplete → New
Revision history for this message
robin (robinp) wrote : Re: [GNOME-Flashback] Xorg memory use gradually increases over time, eventually requiring a restart

I'm not sure how to progress, is there anything else you can suggest I do?

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

I'm curious as to whether regular Ubuntu sessions (GNOME, not Flashback) have the same bug... That would also give you the option of Wayland or Xorg sessions.

Revision history for this message
robin (robinp) wrote :

OK, I'll try out GNOME on Wayland for the next few days, see what happens.

Revision history for this message
robin (robinp) wrote (last edit ):

I've been running my system in GNOME/XWayland for nearly a day now, this is the relevant info from top:

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15590 robin 20 0 2128664 1.7g 53248 S 7.6 22.6 15:02.90 Xwayland

It's been steadily climbing over that time, watching a film with vlc had the biggest effect on it.

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

Yes Xwayland is built from the Xorg source. So again we have a leak either in an X11 app, or in the Xorg code base.

To figure out what is to blame you would need to spend time with/without particular apps running.

Revision history for this message
robin (robinp) wrote :

OK, I'll see what i can do over the next few days. Any recommendations, or is it merely a case of leave one software running for a few hours while watching the memory use?

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

Sadly, I think if an app is to blame then most likely you need to be using it for it to leak.

Revision history for this message
robin (robinp) wrote :

It's VLC, I watched a couple of videos last night, every time I switched to "top", the memory use had gone up. I did little else with other software, so I'm confident it's that.

affects: ubuntu → vlc (Ubuntu)
summary: - [GNOME-Flashback] Xorg memory use gradually increases over time,
- eventually requiring a restart
+ Xorg memory use gradually increases over time, eventually requiring a
+ restart
Revision history for this message
robin (robinp) wrote :

Hi, what's the situation here? The problem still exists, is there anything else I can do to diagnose or fix the problem?

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

I suggest the bug needs to be reported upstream to VLC - https://wiki.videolan.org/Report_bugs/

Revision history for this message
robin (robinp) wrote :

Seriously, you waited four months to say that? Why am I reporting bugs here exactly?

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

Because this is the only place where you can report a bug against Ubuntu in general without knowing which component is to blame. I apologise for not suggesting the next step earlier.

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.