Metacity memory leak
I'm seeing a very large memory leak from Metacity. I'm running Mint 19.1 and Metacity. In one instance Metacity is using 997MB however, if I temporarily switch to Marco and then switch back, Metacity uses just 35.9MB -- evidence of a leak.
My on-line searches reveal that this leak has been reported many years ago but evidently remains. I do run an application that renders extensively to an X11 window is that the cause? Apart for restarting Metacity periodically. Is there a fix?
This is what TOP looks like for my OpenGL graphics intensive program. Xorg is at 90% of CPU use but Metacity has 11%. My own application (Electric) just 8.6%.
Tasks: 247 total, 2 running, 166 sleeping, 0 stopped, 1 zombie
%Cpu(s): 11.7 us, 6.9 sy, 0.0 ni, 81.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 16371884 total, 2977660 free, 3293108 used, 10101116 buff/cache
KiB Swap: 2097148 total, 2097148 free, 0 used. 12710320 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1020 root 20 0 428788 138832 61988 R 90.0 0.8 261:44.07 Xorg
1940 clive 20 0 509064 46616 34912 S 13.6 0.3 93:13.28 mate-system-mon
26303 clive 20 0 1055736 600152 25360 S 11.0 3.7 1:10.03 metacity
1653 clive 20 0 730712 219572 24788 S 10.0 1.3 28:57.65 wnck-applet
26383 clive 20 0 1335588 1.057g 30600 S 8.6 6.8 1:08.08 Electric
24328 clive 20 0 467604 31260 22676 S 5.0 0.2 1:35.75 gtk-window-deco
24881 clive 20 0 603136 38396 26436 S 4.3 0.2 0:33.84 mate-terminal
1610 clive 20 0 1256736 35496 26504 S 3.0 0.2 9:59.66 mate-settings-d
2109 clive 20 0 2490708 211236 85588 S 2.0 1.3 29:58.99 codelite
25114 clive 20 0 44424 4264 3288 R 0.3 0.0 0:03.03 top
1 root 20 0 225632 9452 6772 S 0.0 0.1 0:01.34 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H
6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq
7 root 20 0 0 0 0 S 0.0 0.0 0:00.13 ksoftirqd/0
8 root 20 0 0 0 0 I 0.0 0.0 0:07.44 rcu_sched
9 root 20 0 0 0 0 I 0.0 0.0 0:00.00 rcu_bh
10 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/0