Public bug reported:
## Summary
While the session is locked, gnome-shell allocates GPU buffer objects on the
Intel GPU (i915; shmem-backed, charged to `[email protected]`)
at about 20 MB/s (~1.2 GB/min) and does not free them. During the lock the
HDMI monitor disconnects and reconnects about every 66 seconds, and the growth
stops whenever HDMI is disconnected. The memory is released only when the lock
screen is woken for unlocking. If the screen stays locked for ~45 minutes, the
machine runs out of memory (64 GB RAM + 8 GB swap) and the kernel OOM killer
kills applications and then the whole user session. Those processes have small
RSS, so killing them frees almost nothing.
The leak does not happen when the same monitors are connected over USB-C
(DP Alt Mode).
## Environment
- Ubuntu 24.04.5 LTS, kernel 7.0.0-44-generic
- gnome-shell 46.0-0ubuntu6~24.04.17
- mutter (libmutter-14-0) 46.2-1ubuntu0.24.04.18
- mesa 25.2.8-0ubuntu0.24.04.5, libdrm 2.4.125
- Session: Wayland
- Hardware: Lenovo ThinkPad P16s Gen 4
- Intel Arrow Lake-P [8086:7d51], i915 driver. It drives all outputs (eDP-1,
DP-1..4, HDMI-A-1)
- NVIDIA [10de:2db9], nouveau driver, drives no outputs
- Monitors: internal eDP-1 (1920x1200) + 2x external 2560x1440 (one on
HDMI-A-1, one on DP-1)
- Enabled extensions: ding, tiling-assistant, ubuntu-appindicators, ubuntu-dock
(Ubuntu defaults)
## Steps to reproduce
1. Connect an external monitor over the laptop's HDMI port.
2. Watch the gnome-shell cgroup's shmem:
```
watch -n5 "awk '/^shmem /{print \$2/2^20\" MB\"}' \
/sys/fs/cgroup/user.slice/user-\$(id -u).slice/user@\$(id
-u).service/session.slice/[email protected]/memory.stat"
```
The i915 GEM total in `/proc/$(pgrep -x gnome-shell)/fdinfo/<drm fd>`
(`drm-total-system0`) grows at the same rate.
3. Lock the screen (Super+L) and don't touch anything.
## Expected
gnome-shell's memory stays flat while locked.
## Actual
Shmem/GEM grows linearly at ~20 MB/s for as long as the screen is locked.
- Blanking the screens (DPMS off) does **not** stop it.
- While locked, HDMI-A-1 shows as disconnected/reconnected about every 66 s
(`/sys/class/drm/card1-HDMI-A-1/status`). Growth pauses while it is
disconnected.
- Waking the lock screen (just bringing up the auth prompt) frees all of it at
once.
- Nothing leaks while the session is unlocked.
## Measurements (5 s sampling, logs attached)
| Test | Outputs | While locked |
|---|---|---|
| 1 | eDP + DP + HDMI, idle-delay=0 (screens on) | 523 MB → 3,764 MB in 3.5 min
|
| 2 | eDP + DP + HDMI, screens blanked (DPMS Off) | 522 MB → 9,133 MB in 9 min |
| 3 | eDP + 2x DP over USB-C, screens blanked | 471 MB → 472 MB in 7.7 min |
## Real-world impact (kernel log attached)
The screen was left locked for a long stretch with HDMI connected. The kernel
OOM
report showed `shmem:54565960kB`, `mapped:546004kB` and swap exhausted, while
the
RSS of all processes added up to only ~2 GB. The OOM killer killed chrome, then
java.
systemd-oomd reported `[email protected] Current Memory Usage:
52.3G`
just before the user session was killed. The same session teardown (52.1 GB
peak)
also appears on an earlier day.
## Attachments
- test1-hdmi-screens-on.log, test2-hdmi-screens-blanked.log,
test3-usbc-no-leak.log
- oom-kernel-report.log (kernel OOM report)
- oomd-gnome-shell-52G.log (systemd-oomd cgroup listing)
** Affects: gnome-shell (Ubuntu)
Importance: Undecided
Status: New
** Attachment added: "oomd-gnome-shell-52G.log"
https://bugs.launchpad.net/bugs/2179478/+attachment/6022794/+files/oomd-gnome-shell-52G.log
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2179478
Title:
gnome-shell leaks ~20 MB/s of i915 GEM (shmem) memory while the screen
is locked with an HDMI monitor connected, leading to a system-wide OOM
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2179478/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs