OpenTabletDriver icon indicating copy to clipboard operation
OpenTabletDriver copied to clipboard

Memory leak of main UI on Linux (UX.Gtk)

Open MrApplejuice opened this issue 2 years ago • 11 comments

Acknowledgements

  • [X] I have installed OpenTabletDriver by following its official installation instructions.
  • [X] I have checked the OpenTabletDriver Wiki and respective FAQ pages, and my issue was not covered or actually fixed.
  • [X] I have searched the existing issues and this new issue is not a duplicate of any.
  • [X] I have written a concise and meaningful title.

Steps to Reproduce

Basic steps:

  • Leave the application open for a long time (8 hours+).
  • Maybe: Connect and disconnect a graphics tablet a lot (I might have used a shoddy USB cable and the tablet might have disconnected and reconnected for hours on end)

System: Xubuntu 20.04

paul@amd3900x:~$ uname -a
Linux amd3900x 5.4.0-120-generic #136-Ubuntu SMP Fri Jun 10 13:40:48 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Expected Behavior

Application uses a lot less than 30 GB of memory.

Observed Behavior

When I woke up my computer from standby, I noticed that half of my system memory (64 GB) was occupied, most of it by OpenTableDriver.UX.Gtk.

Here the relevant top output:

top - 11:03:24 up 3 days, 17:34,  2 users,  load average: 4,39, 3,17, 3,06
Tasks: 670 total,   2 running, 667 sleeping,   0 stopped,   1 zombie
%Cpu(s):  8,8 us,  0,0 sy,  0,0 ni, 91,2 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
MiB Mem :  64245,9 total,   6719,1 free,  42742,2 used,  14784,6 buff/cache
MiB Swap:      0,0 total,      0,0 free,      0,0 used.  20080,9 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                  
 338458 paul      20   0   34,2g  29,8g  89712 S   0,0  47,5  36:23.76 /usr/share/OpenTabletDriver/OpenTabletDriver.UX.Gtk                                                      
 272972 paul      20   0 6340512   2,2g  44312 S   0,0   3,4   6:05.11 /usr/share/OpenTabletDriver/OpenTabletDriver.Daemon -c /usr/share/OpenTabletDriver/Configurations    

This is the view that was open:

grafik

Tablet Device

Huion S610

Diagnostic Information

I got an error while saving the diagnostics:

grafik

The diagnostics-file ended up being 200 MB in size. So I zipped it and attached it that way.

diag.zip

Here a tail and head of that file

HEAD

{
  "App Version": "OpenTabletDriver v0.6.0.4",
  "Build Date": "05/04/2022",
  "Operating System": {
    "Platform": 4,
    "ServicePack": "",
    "Version": "5.4.0.120",
    "VersionString": "Unix 5.4.0.120"
  },
  "Environment Variables": {
    "USER": "paul",
    "TEMP": null,
    "TMP": null,
    "TMPDIR": null,
    "DISPLAY": ":0.0",
    "WAYLAND_DISPLAY": null,
    "PWD": "/home/paul",
    "PATH": "/home/paul/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
  },
  "HID Devices": [
    {
      "DevicePath": "/sys/devices/pci0000:00/0000:00:08.1/0000:08:00.3/usb3/3-1/3-1.1/3-1.1:1.3/0003:041E:323B.0001/hidraw/hidraw0",
      "Manufacturer": "Creative Technology Ltd",
      "ProductName": "Sound Blaster E1",
      "SerialNumber": "0000011682",
      "FriendlyName": "Sound Blaster E1",
      "VendorID": 1054,
      "ProductID": 12859,
      "InputReportLength": 3,
      "OutputReportLength": 6,
      "FeatureReportLength": 2,
      "CanOpen": true
    },
    {
      "DevicePath": "/sys/devices/pci0000:00/0000:00:08.1/0000:08:00.3/usb3/3-1/3-1.2/3-1.2:1.0/0003:046D:C05B.0008/hidraw/hidraw1",
      "Manufacturer": "Logitech",
      "ProductName": "USB Optical Mouse",
      "SerialNumber": "",
      "FriendlyName": "USB Optical Mouse",
      "VendorID": 1133,
      "ProductID": 49243,
      "InputReportLength": 7,
      "OutputReportLength": 0,
      "FeatureReportLength": 0,
      "CanOpen": true
    },
    {
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:01:00.0/usb1/1-5/1-5:1.0/0003:256C:006D.0017/hidraw/hidraw6",
      "Manufacturer": "HUION",
      "ProductName": "Huion Tablet",
      "SerialNumber": "",
      "FriendlyName": "Huion Tablet",
      "VendorID": 9580,
      "ProductID": 109,
      "InputReportLength": 12,
      "OutputReportLength": 0,
      "FeatureReportLength": 0,
      "CanOpen": true
    },
    {
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:01:00.0/usb1/1-5/1-5:1.1/0003:256C:006D.0018/hidraw/hidraw7",
      "Manufacturer": "HUION",
      "ProductName": "Huion Tablet",
      "SerialNumber": "",
      "FriendlyName": "Huion Tablet",
      "VendorID": 9580,
      "ProductID": 109,
      "InputReportLength": 10,
      "OutputReportLength": 0,
      "FeatureReportLength": 0,
      "CanOpen": true
    }
  ],
  "Console Log": [
    {
      "Time": "2022-06-21T11:09:14.9232911+02:00",
      "Group": "Detect",
      "Message": "Searching for tablets...",
      "StackTrace": null,
      "Level": 1,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9233339+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet '10moon 1060N'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9233469+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Acepen AP 1060'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9233581+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Artisul A1201'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.923369+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Artisul AP604'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9233805+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Artisul M0610 Pro'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9233916+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon 1060 Pro'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9234025+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon M106K Pro'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9234133+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon M106K'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9234243+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon M10K Pro'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9234352+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon M10K'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9234463+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon M1220'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9234572+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon M1230'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9234681+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon M6'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9234789+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon PD1161'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9234898+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon PD1560'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9235011+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon PD1561'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9235122+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon S56K'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9235231+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon S620'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9235346+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Gaomon S630'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9235455+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Genius G-Pen 560'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9235566+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Genius i608x'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:14.9235679+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Huion 420'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },

(... omitting 7.6 million lines ...)

TAIL

    {
      "Time": "2022-06-21T11:09:20.6376822+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom GD-0912-U'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6376875+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom GD-1212-U'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6376929+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom GD-1218-U'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6376983+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom MTE-450'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377037+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTH-450'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377092+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTH-451'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377148+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTH-460'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377201+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTH-650'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377256+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTH-651'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.637731+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTH-660'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377364+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTH-850'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377418+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTH-851'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377477+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTH-860'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377531+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTK-1240'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377585+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTK-440'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377642+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTK-450'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377697+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTK-540WL'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377753+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTK-640'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377807+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTK-650'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377861+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTK-840'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377914+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTZ-1230'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6377968+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTZ-1231W'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378022+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTZ-430'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378076+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTZ-431W'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378129+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTZ-630'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378185+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTZ-631W'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378248+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom PTZ-930'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378303+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom XD-0405-U'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378357+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom XD-0608-U'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378411+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom XD-0912-U'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378466+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom XD-1212-U'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378524+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'Wacom XD-1218-U'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378578+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XenceLabs Pen Tablet Medium'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378633+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XenceLabs Pen Tablet Small'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378689+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XENX P1-640'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378749+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XENX P3-1060'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378804+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XENX X1-640'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378858+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Artist 12 (2nd Gen)'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378911+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Artist 12 Pro'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6378968+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Artist 12'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379025+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Artist 13.3 Pro'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379078+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Artist 15.6 Pro'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379132+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Artist 15.6'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379186+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Artist 22HD'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.637924+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen CT1060'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379307+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen CT430'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379363+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen CT640'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379417+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Deco 01 V2 (variant 2)'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379473+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Deco 01 V2'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379528+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Deco 01'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379582+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Deco 02'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379636+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Deco 03'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379691+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Deco mini4'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379744+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Deco mini7'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379802+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Deco Pro Medium'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379856+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Deco Pro Small'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379911+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Innovator 16'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6379965+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star 03'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380026+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star 05 V3'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380079+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star 06'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380137+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star 06C'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380199+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star G430'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380255+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star G430S V2'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.638031+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star G430S'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380365+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star G540 Pro'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380419+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star G540'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380472+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star G640 V2'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380526+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star G640'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380582+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star G640S'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380638+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star G960'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380693+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star G960S Plus'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380747+02:00",
      "Group": "Detect",
      "Message": "Searching for tablet 'XP-Pen Star G960S'",
      "StackTrace": null,
      "Level": 0,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380802+02:00",
      "Group": "Huion HS610",
      "Message": "Output mode: Artist Mode",
      "StackTrace": null,
      "Level": 1,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380857+02:00",
      "Group": "Huion HS610",
      "Message": "Display area: [1920x1080@<2880. 540>:0°],",
      "StackTrace": null,
      "Level": 1,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6380912+02:00",
      "Group": "Huion HS610",
      "Message": "Tablet area: [254x158,75@<127. 79,375>:0°],",
      "StackTrace": null,
      "Level": 1,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.638097+02:00",
      "Group": "Huion HS610",
      "Message": "Clipping: Enabled",
      "StackTrace": null,
      "Level": 1,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6381024+02:00",
      "Group": "Huion HS610",
      "Message": "Ignoring reports outside area: Disabled",
      "StackTrace": null,
      "Level": 1,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6381077+02:00",
      "Group": "Huion HS610",
      "Message": "Pen Bindings: OpenTabletDriver.Desktop.Binding.LinuxArtistMode.LinuxArtistModeButtonBinding, ",
      "StackTrace": null,
      "Level": 1,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6381134+02:00",
      "Group": "Huion HS610",
      "Message": "Express Key Bindings: Key Binding: Subtract, Key Binding: Plus, , , Multi-Key Binding: Control+Y, Multi-Key Binding: Control+Z, , , , , , ",
      "StackTrace": null,
      "Level": 1,
      "Notification": false
    },
    {
      "Time": "2022-06-21T11:09:20.6381188+02:00",
      "Group": "Settings",
      "Message": "Driver is enabled.",
      "StackTrace": null,
      "Level": 1,
      "Notification": false
    }
  ]
}

MrApplejuice avatar Jun 21 '22 09:06 MrApplejuice

This might be a duplicate of https://github.com/OpenTabletDriver/OpenTabletDriver/issues/2200, but I am not sure...

MrApplejuice avatar Jun 21 '22 09:06 MrApplejuice

likely that was the case, detection being invoked repeatedly causing 7.8 million+ lines of a diagnostic to be stored most likely with no compression at all

jamesbt365 avatar Jun 21 '22 09:06 jamesbt365

Going to do some testing about a memory leak though.

jamesbt365 avatar Jun 21 '22 09:06 jamesbt365

Thanks for looking into this!

I was not sure about the large log-file being the only issue: 7.8 million times - ~100 bytes(?) would be an order of magnitude smaller at ~1 GB than 30 GB. So I would expect something else might be going on as well. However, I am really not super familiar with .NET or this project.

Maybe some very delayed garbage-collection that needs to be contained on systems with large memory or something could also be the reason? Admittedly, I am just guessing at this point :-)

MrApplejuice avatar Jun 21 '22 10:06 MrApplejuice

Yeah this sounds like #2200, though that issue says it should be the daemon getting affected by high memory usage.

I'm not convinced this is caused by logging only, there could also be a memory leak in the UX process if your tablet was reconnected a lot of times.

gonX avatar Jun 21 '22 15:06 gonX

Is there a tool in .NET that I can use to create a HeapDump maybe? I remember back in my Java-days there was a tool called jconsole that was used for that. Maybe that way I could help in checking if it is actually the logging? Happy to help, if I can get a few .NET related directions for handy tools wrt this (and I am able to reproduce the problem in the first place).

MrApplejuice avatar Jun 21 '22 17:06 MrApplejuice

Seeing the same under OSX Big Sur 11.4 (20F71). OpenTabletDriver v0.5.3.3

Screen Shot 2022-06-29 at 01 57 56

I believe I had left it running for weeks. No filters/tools/interpolators. Daily disconnect/reconnect when using USB dock.

May I suggest a quick fix for this issue and possibly #2200 (if it's the same issue) would be to have a checkbox, disabled by default, to disable the diagnostics tab / logging? So unless you actually want all that diagnostics generated, it doesn't bother?

globalcitizen avatar Jun 28 '22 18:06 globalcitizen

This is under every platform and will be addressed by the undergoing rework on both the ui and daemon.

jamesbt365 avatar Jun 28 '22 18:06 jamesbt365

Seeing the same under OSX Big Sur 11.4 (20F71). OpenTabletDriver v0.5.3.3

Screen Shot 2022-06-29 at 01 57 56

I believe I had left it running for weeks. No filters/tools/interpolators. Daily disconnect/reconnect when using USB dock.

May I suggest a quick fix for this issue and possibly #2200 (if it's the same issue) would be to have a checkbox, disabled by default, to disable the diagnostics tab / logging? So unless you actually want all that diagnostics generated, it doesn't bother?

You are running old version of otd.

AkiSakurai avatar Jun 29 '22 01:06 AkiSakurai

You are running old version of otd.

OK thanks I will upgrade. Can't be that old - I only installed it a few months ago!

globalcitizen avatar Jun 29 '22 08:06 globalcitizen

This needs to be tested again in master

jamesbt365 avatar Sep 18 '22 13:09 jamesbt365

Hey - got around compiling master two days ago so. Unfortunately the memory leak is still there I think. Here the top-output::

top - 21:44:20 up 25 days, 12:33,  5 users,  load average: 1,28, 1,56, 3,47
Tasks: 601 total,   1 running, 600 sleeping,   0 stopped,   0 zombie
%Cpu(s):  3,2 us,  0,6 sy,  0,0 ni, 96,0 id,  0,0 wa,  0,0 hi,  0,2 si,  0,0 st
MiB Mem :  64245,8 total,   6943,2 free,  21211,1 used,  36091,5 buff/cache
MiB Swap:      0,0 total,      0,0 free,      0,0 used.  34229,3 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                                                
 278852 paul      20   0   10,3g   5,9g  79,5m S   0,0   9,3   6:18.25 /usr/share/OpenTabletDriver/OpenTabletDriver.UX.Gtk                                                                                                                    
3687494 paul      20   0   17,4g   4,1g  43,8m S   0,7   6,6 174:09.02 /home/paul/local/android-studio/jre/bin/java -classpath /home/paul/local/android-studio/lib/bootstrap.jar:/home/paul/local/android-studio/lib/util.jar:/home/paul/loc+ 
 278319 paul      20   0 5730,9m   1,6g  45,2m S   0,0   2,6   2:25.41 /usr/share/OpenTabletDriver/OpenTabletDriver.Daemon -c /usr/share/OpenTabletDriver/Configurations 
[...]

It is not (yet) as severe as it used to be, but from the program's behavior, I thing it would have gotten to the point. What I observed was that after waking up my PC from sleep, the OpenTabletUX that I left open would detect my Huion-tablet, but then loose it again, detect it again and loose it again, and so on. Disconnecting and reconnecting the tablet solved the problem.

I extracted the logs again and it again is already 1.7 million lines long. :

Here the head
[...]
{
  "AppVersion": "OpenTabletDriver v0.7.0.0+89e2f525",
  "BuildDate": "",
  "OperatingSystem": {
    "Platform": 4,
    "ServicePack": "",
    "Version": "5.4.0.126",
    "VersionString": "Unix 5.4.0.126"
  },
  "EnvironmentVariables": {
    "USER": "paul",
    "DISPLAY": ":0",
    "PWD": "/home/paul",
    "PATH": "/home/paul/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/paul/.dotnet/tools"
  },
  "Devices": [
    {
      "ProductID": 49243,
      "VendorID": 1133,
      "InputReportLength": 7,
      "OutputReportLength": 0,
      "FeatureReportLength": 0,
      "Manufacturer": "Logitech",
      "ProductName": "USB Optical Mouse",
      "FriendlyName": "USB Optical Mouse",
      "SerialNumber": "",
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-4/1-4.2/1-4.2:1.0/0003:046D:C05B.0037/hidraw/hidraw0",
      "CanOpen": true
    },
    {
      "ProductID": 1031,
      "VendorID": 4176,
      "InputReportLength": 65,
      "OutputReportLength": 65,
      "FeatureReportLength": 0,
      "Manufacturer": "Yubico",
      "ProductName": "YubiKey OTP+FIDO+CCID",
      "FriendlyName": "YubiKey OTP+FIDO+CCID",
      "SerialNumber": "0019652419",
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-4/1-4.3/1-4.3:1.1/0003:1050:0407.0053/hidraw/hidraw8",
      "CanOpen": true
    },
    {
      "ProductID": 5666,
      "VendorID": 4152,
      "InputReportLength": 6,
      "OutputReportLength": 0,
      "FeatureReportLength": 0,
      "Manufacturer": "SteelSeries",
      "ProductName": "SteelSeries Apex 3 TKL",
      "FriendlyName": "SteelSeries Apex 3 TKL",
      "SerialNumber": "",
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-4/1-4.4/1-4.4:1.3/0003:1038:1622.0062/hidraw/hidraw4",
      "CanOpen": true
    },
    {
      "ProductID": 12859,
      "VendorID": 1054,
      "InputReportLength": 3,
      "OutputReportLength": 6,
      "FeatureReportLength": 2,
      "Manufacturer": "Creative Technology Ltd",
      "ProductName": "Sound Blaster E1",
      "FriendlyName": "Sound Blaster E1",
      "SerialNumber": "0000011682",
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-4/1-4.1/1-4.1:1.3/0003:041E:323B.0064/hidraw/hidraw6",
      "CanOpen": true
    },
    {
      "ProductID": 5666,
      "VendorID": 4152,
      "InputReportLength": 33,
      "OutputReportLength": 2,
      "FeatureReportLength": 0,
      "Manufacturer": "SteelSeries",
      "ProductName": "SteelSeries Apex 3 TKL",
      "FriendlyName": "SteelSeries Apex 3 TKL",
      "SerialNumber": "",
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-4/1-4.4/1-4.4:1.2/0003:1038:1622.0061/hidraw/hidraw3",
      "CanOpen": true
    },
    {
      "ProductID": 5666,
      "VendorID": 4152,
      "InputReportLength": 65,
      "OutputReportLength": 65,
      "FeatureReportLength": 0,
      "Manufacturer": "SteelSeries",
      "ProductName": "SteelSeries Apex 3 TKL",
      "FriendlyName": "SteelSeries Apex 3 TKL",
      "SerialNumber": "",
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-4/1-4.4/1-4.4:1.4/0003:1038:1622.0063/hidraw/hidraw5",
      "CanOpen": true
    },
    {
      "ProductID": 5666,
      "VendorID": 4152,
      "InputReportLength": 65,
      "OutputReportLength": 65,
      "FeatureReportLength": 257,
      "Manufacturer": "SteelSeries",
      "ProductName": "SteelSeries Apex 3 TKL",
      "FriendlyName": "SteelSeries Apex 3 TKL",
      "SerialNumber": "",
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-4/1-4.4/1-4.4:1.1/0003:1038:1622.0060/hidraw/hidraw2",
      "CanOpen": true
    },
    {
      "ProductID": 5666,
      "VendorID": 4152,
      "InputReportLength": 9,
      "OutputReportLength": 2,
      "FeatureReportLength": 0,
      "Manufacturer": "SteelSeries",
      "ProductName": "SteelSeries Apex 3 TKL",
      "FriendlyName": "SteelSeries Apex 3 TKL",
      "SerialNumber": "",
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-4/1-4.4/1-4.4:1.0/0003:1038:1622.005F/hidraw/hidraw1",
      "CanOpen": true
    },
    {
      "ProductID": 1031,
      "VendorID": 4176,
      "InputReportLength": 9,
      "OutputReportLength": 2,
      "FeatureReportLength": 9,
      "Manufacturer": "Yubico",
      "ProductName": "YubiKey OTP+FIDO+CCID",
      "FriendlyName": "YubiKey OTP+FIDO+CCID",
      "SerialNumber": "0019652419",
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-4/1-4.3/1-4.3:1.0/0003:1050:0407.0088/hidraw/hidraw7",
      "CanOpen": true
    },
    {
      "ProductID": 109,
      "VendorID": 9580,
      "InputReportLength": 10,
      "OutputReportLength": 0,
      "FeatureReportLength": 0,
      "Manufacturer": "HUION",
      "ProductName": "Huion Tablet",
      "FriendlyName": "Huion Tablet",
      "SerialNumber": "",
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-5/1-5:1.1/0003:256C:006D.008A/hidraw/hidraw14",
      "CanOpen": true
    },
    {
      "ProductID": 109,
      "VendorID": 9580,
      "InputReportLength": 12,
      "OutputReportLength": 0,
      "FeatureReportLength": 0,
      "Manufacturer": "HUION",
      "ProductName": "Huion Tablet",
      "FriendlyName": "Huion Tablet",
      "SerialNumber": "",
      "DevicePath": "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-5/1-5:1.0/0003:256C:006D.0089/hidraw/hidraw13",
      "CanOpen": true
    }
  ],
  "ConsoleLog": [
    {
      "Time": "2022-10-20T21:34:55.8496701+02:00",
      "Group": "Detect",
      "Message": "Searching for tablets...",
      "StackTrace": null,
      "Level": 1,
      "Notification": false
    },
[...]

And I attached big chunk of the tail (30k lines) to this post: log-tail.txt

What strikes me as suspicious is that the detection logs at the end seem to search for new devices every 20 milliseconds, filling up the log in no time. Maybe that is another bug?

Anyway, that bug seemingly still fills up my memory, also of the daemon. Restarting the UI brought back its memory use (RSS) to a more manageable 160 MB, restarting the Daemon reduced its memory use to 100 MB.

MrApplejuice avatar Oct 20 '22 19:10 MrApplejuice

@MrAppleJuice Suggestion: first rule out hardware issues. USB can be very unreliable, and the number one issue is insufficient power for attached devices causing brownouts causing device restarts (particularly if you are on a laptop and it is not plugged to a wall). To rule this out use a good quality, externally powered USB hub between the laptop and the device. If the problem goes away, you have your culprit. Linux syslog will often explain in detail how driver assumptions about device behavior are being broken. The number two issue is cheap cables and EMI. If you have big devices nearby and unshielded cables the cables can act as antennae and pick up interference. One thing to do in this case is to replace your USB cable with a high quality one with a built-in ferrite, or get a clip-on ferrite.

globalcitizen avatar Oct 21 '22 21:10 globalcitizen

Nope. None of those. The mass logging is not caused from any usb problems but a flaw in the sleep detection logic. That is fixed in #2236

jamesbt365 avatar Oct 21 '22 21:10 jamesbt365

@MrApplejuice Suggestion: first rule out hardware issues. [...]

Hey, thanks for the tip. Brown-outs were actually an issue in the past for the tablet when I tried to connect it to a (powered!) USB-Hub. As a mitigation, I use a USB 2.0 port of my PC directly now. Still, thank you a lot for wanting to help out and debugging this with me!

Nope. None of those. The mass logging is not caused from any usb problems but a flaw in the sleep detection logic. That is fixed in #2236

That sounds like it might be the issue for causing the big logging spike. Thanks for the PR, I will wait until it reaches master and then try again!

MrApplejuice avatar Oct 22 '22 09:10 MrApplejuice