Xpra: Ticket #610: Xorg memory leak while resizing

Current versions: Server:

Clients(both reproducable in):

Running a session with Chrome and Firefox open along with a couple of Xterms. Resizing Firefox and letting it sit for a second, then resizing it again, over and over again causes the memory usage to steadily climb until the server runs out of memory and Xpra crashes printing:

Xpra: Fatal IO error 11 (Resource temporarily unavailable) on X server :13.
firefox: Fatal IO error 11 (Resource temporarily unavailable) on X server :13.
xterm: fatal IO error 11 (Resource temporarily unavailable) or KillClient on X server ":13"
xterm: fatal IO error 11 (Resource temporarily unavailable) or KillClient on X server ":13"
[6610:6610:0702/120253:ERROR:x11_util.cc(81)] X IO error received (X server probably went away)
[6501:6501:0702/120253:ERROR:chrome_browser_main_extra_parts_x11.cc(56)] X IO error received (X server probably went away)

A top from before it crashed shows that the Xorg is holding an excessive amount of memory:

top - 14:33:10 up 7 days,  5:02,  6 users,  load average: 0.94, 0.77, 0.48
Tasks: 151 total,   1 running, 150 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.8 us,  0.2 sy,  0.0 ni, 98.9 id,  0.0 wa,  0.1 hi,  0.0 si,  0.0 st
KiB Mem:   4048360 total,  3940652 used,   107708 free,      284 buffers
KiB Swap:  1257468 total,  1257468 used,        0 free,    26996 cached
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
16261 jimador   20   0 4180152 2.731g  10008 S   0.0 70.7   1:57.61 ld-linux-x8+
16286 jimador   20   0 1549060 609328   2880 D  11.4 15.1   6:14.33 firefox
16251 jimador   20   0 1815640 245712   8660 S  11.4  6.1  17:21.42 xpra
18869 jimador   20   0  963204  86916   2828 S   5.7  2.1   1:49.01 plugin-cont+
    1 root      20   0   49824   1336     60 S   0.0  0.0   0:03.12 systemd
25108 jimador   20   0  119420   1100    756 R   0.0  0.0   0:00.01 top
 5678 jimador   20   0  353700    672    152 S   5.7  0.0  18:51.49 pulseaudio
 9627 jimador   20   0  135704    504    220 S   0.0  0.0   0:01.42 sshd
 9628 jimador   20   0  115348    372    120 S   0.0  0.0   0:00.03 bash
  340 dbus      20   0   34760    368     48 S   0.0  0.0   0:01.07 dbus-daemon
  710 polkitd   20   0  515088    368      0 S   0.0  0.0   0:00.56 polkitd
17351 jimador   20   0  119292    340      0 S   0.0  0.0   0:06.90 top
 1068 jimador   20   0  135812    324     44 S   0.0  0.0   0:00.37 sshd
 9619 root      20   0  135704    296     48 S   0.0  0.0   0:00.30 sshd
 1069 jimador   20   0  115348    292     48 S   0.0  0.0   0:00.05 bash
10030 jimador   20   0  135700    252     96 S   0.0  0.0   0:00.94 sshd
 1064 root      20   0  135704    236      0 S   0.0  0.0   0:00.13 sshd

On this machine it seems to max out at approximately 85% of the total memory being used(which is over 3GBs of memory), but another session maxed out at 87% and then I left it idle for an hour and it had slowly dropped down to about 70% memory used and held there for about 20 minutes usage before Xpra crashed again.



Wed, 02 Jul 2014 21:59:39 GMT - J. Max Mena: component changed


Thu, 03 Jul 2014 08:52:02 GMT - Antoine Martin: owner changed

I believe there might be a ticket for this already. Can you try to narrow it down by testing older versions (0.11?) To see if those are also affected.


Mon, 07 Jul 2014 23:26:01 GMT - J. Max Mena:

#535 mentioned the X11 server holding.

I retested with a few versions 11.0, 12.1, and they all had the leak. I can do some more in-depth testing but even versions as far back as 11.1 have the leak I doubt any version in between won't. Any other ideas of what to test?


Tue, 08 Jul 2014 00:40:28 GMT - Antoine Martin:

Maybe try even older versions, 0.7 and 0.9 in particular. (0.9 might crash..)

Also try turning off xshm with XPRA_XSHM=0 xpra start ...


Thu, 10 Jul 2014 16:29:19 GMT - Antoine Martin:

Does r6874 fix the problem for you? in the end, it was very easy to see with xrestop (pointing to a pixmap leak)

Will close as duplicate of #535 if the fix is also confirmed there.


Fri, 11 Jul 2014 18:31:37 GMT - J. Max Mena:

Re-tested with r6888 14.0 Fedora 20 server. Seems to have fixed it for me. I even tried resizing to a really oversized window across 2 1080p monitors and never saw memory usage go over what Firefox was using.


Fri, 11 Jul 2014 21:31:12 GMT - Antoine Martin: status changed; resolution set

Closing.


Sat, 23 Jan 2021 05:00:48 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/610