Xorg memory leak when using ANY wacom device on optimus laptops

Problem: Using wacom+nvidia proprietary on blender and using the grease pencil generates an xorg leak that grows as you use more and more the wacom device (this also happens with krita, opentoonz with vector layers and other drawing programs)

This appears on optimus laptops at the moment and I don’t know if it happens with desktops

This doesn’t happen when not using nvidia (i.e. using nvidia-prime intel), I suppose is an nvidia issue since it doesn’t happen with anything but when using nvidia proprietary drivers.
This always happens, regardless of the hardware as far as I know (tested with 940mx, 940m and 920m)

To replicate:

  1. Have nvidia proprietary drivers, nvidia prime set to the nvidia card and any wacom device connected to your laptop.
  2. Open Blender (this program leaks the memory more effectively) and use the grease pencil to draw something.
  3. With the task manager open to the side (gnome task manager, htop, any task manager that can see the xorg process memory usage) you can see how the xorg memory increases the more you draw.

(Hardware)

Current personal laptop

OS: KDE neon User Edition 5.15 x86_64
Host: 80X8 Lenovo YOGA 520-14IKB
CPU: Intel i3-7100U (4) @ 2.400GHz
GPU: NVIDIA GeForce 940MX
GPU: Intel HD Graphics 620
Memory: 7843MiB

Wacom devices tested with

Intuos (Medium and small)
Lenovo yoga pen display with Active pen