| Ticket UUID: | c2f501a5a0531aee5ada738c9a31213c1818b51a | |||
| Title: | [SOLVED] Tk apps get progressively slower on Debian 13 running X11 | |||
| Type: | Bug | Version: | 8.6.16 | |
| Submitter: | diannes | Created on: | 2025-11-01 16:07:49 | |
| Subsystem: | 67. Unix Window Operations | Assigned To: | nobody | |
| Priority: | 5 Medium | Severity: | Important | |
| Status: | Open | Last Modified: | 2026-08-09 14:00:37 | |
| Resolution: | None | Closed By: | nobody | |
| Closed on: | ||||
| Description: |
This is a weird bug that I hope others will be able to replicate. I have a
Tcl/Tk app that runs pretty quickly the first time I start it, but each time I
exit it and restart it, it gets a bit slower. If I log out and log back in
(thereby resetting the X server) it's quick again.
I discovered that wish seems to create a handful of X atoms of the form
"_client%d" and "_server%d_%d" each time a program is run. Are these the
leaking resources that could be slowing things down?
I wrote the following test script to repeatedly start and exit wish:
#!/bin/bash
while true ; do
echo "exit" | wish
done
If I run that script in one window, and the following command in another:
watch "xlsatoms | egrep '(_server|_client)' | wc -l"
I see the count constantly increasing.
Anyway. Hope someone manages to replicate this. :)
Regards,
Dianne.
PS: The specific app that I really notice slowing down is my TkRemind
calendar app, part of https://dianne.skoll.ca/projects/remind/
| |||
| User Comments: |
nemethi (claiming to be Csaba Nemethi) added on 2026-08-09 14:00:37:
@diannes: Many thanks for your very useful hint! diannes added on 2026-08-08 19:57:03: @nemethi, a better workaround for you might be to invoke Tk tests with the XMODIFIERS environment variable set to the empty string: XMODIFIERS='' wish script.tcl This apparently prevents Tcl/Tk from using ibus, but it doesn't affect any other running apps. This solution was mentioned at https://github.com/ibus/ibus/issues/2924 nemethi (claiming to be Csaba Nemethi) added on 2026-08-08 19:12:37: Uninstalling ibus is not an option for me because GNOME automatically installs ibus and even depends on it. As a workaround now I stop ibus via diannes added on 2026-08-05 19:00:00: More info at https://github.com/ibus/ibus/issues/2924 diannes added on 2026-08-05 18:50:33: Hello, I have solved it! After searching high and low for anything containing _server%d_%d, it turns out the culprit is ibus. https://github.com/phuang/ibus/blob/99e4d9d7af0bdeaf396bbd26cac949eca7cdfe1d/util/IMdkit/i18nX.c#L280 After uninstalling ibus (only required by Zoom) the problem has gone away. Regards, Dianne. nemethi (claiming to be Csaba Nemethi) added on 2026-08-05 18:40:49: I have the same problem on Ubuntu, which now runs GNOME on Wayland. I don't know whether Tk on XWayland is slower than Tk on Xorg, but the main problem is that Tk applications are getting significantly slower every time they are restarted. For me the slowdown is much worse on Wayland than the one that I was experiencing on Xorg (which came with earlier Ubuntu versions). diannes added on 2026-08-05 17:39:41: Hi, Thanks for your reply. But I'm not running Wayland. It's a pure X11 system running Xorg and XFCE4 as the desktop environment. kevin_walzer added on 2026-08-05 17:18:07: Could it be that XWayland is slower than a full X.org setup? Debian 13 is Wayland-first. A native Wayland port of Tk is under development, but will not be ready until Tk 9.2. diannes added on 2026-08-05 16:59:13: Any updates on this? I am still noticing this problem. :( diannes added on 2025-11-01 16:55:06: It seems that other X11 apps also create _server%d_%d atoms, so it could be my window manager. And indeed, the creation of atoms might not even be behind the slowdown... | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki