|
2026-10-22
| ||
| 17:19 | • Ticket [3461049fff] Tk stops to draw entries (200*50) status still Closed wi... artifact: a749098fcc user: serhiy.storchaka | |
|
2026-10-12
| ||
| 17:31 | • Closed ticket [3461049fff]. artifact: d4ab5b9bb4 user: serhiy.storchaka | |
|
2011-12-17
| ||
| 18:50 | • Ticket [3461049fff]: 4 changes artifact: 4de8f2e1df user: tombert | |
| 01:08 | • Ticket [3461049fff]: 4 changes artifact: 25e270db7e user: tombert | |
|
2011-12-16
| ||
| 17:47 | • New ticket [3461049fff]. artifact: f25189e696 user: tombert | |
Tk stops to draw entries (200*50)
Closed / Duplicate3461049fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 41 days ago
Descriptionplain2011-12-16 17:47:10
Environment: Win7 32bit, Xp 32bit, Tcl 8.5.11 MinGw build and ActiveState;
Running the code below should draw 200 toplevels with each 50 entries. It stops to draw after toplevel 192 and entry 30 without an error message.
When other resources are allocated (e.g. threads) it even stops earlier ... but no error message.
I also experienced that the last entry is drawn outside the toplevel (but not reproducable).
When running with the thread2.7b1 I also can reproduce crashes on exit (reported a separate tracker).
I know its weird to produce 10tsd entries but I'am having crashes using the threading package in my application and this is the code that somehow resembles my problems. Now I'am woried that in my application there are other resources running low without notifying me.
proc entries {} {
for {set top 1} {$top <= 200} {incr top} {
set w [toplevel .top$top]
for {set entry 1} {$entry <= 50} {incr entry} {
set e [entry $w.e$entry]
$e insert end ${top}.${entry}
pack $e -fill x -expand yes
update idletask
}
update
}
puts "."
puts "finished"
}
I'am not totally sure in which category this to put: memory, tk?
thx
tombertplain2011-12-17 01:08:23
I opened a separate tracker for the thread "crash" here: https://sourceforge.net/tracker/?func=detail&aid=3461051&group_id=10894&atid=110894
tombertplain2011-12-17 18:50:54
With the following workflow I'am able to reduce the number of entries on each run:
Run the "entries" procedure so that you end up with one toplevel that does stop drawing entries (on my computer this is 192.36). Then run the code below, which is similar to the one above. While the code is running (see the puts in the console) delete the last window (192) by clicking with the mouse on the X. The next window that opens up has one entry less then the one before (so in my case ???.35)
set ::alltop 201
set ::stoptop 200
proc te {} {
for {set top $::alltop} {$top < ($::alltop + $::stoptop)} {incr top} {
set w [toplevel .top$top]
for {set entry 1} {$entry <= 50} {incr entry} {
puts ${top}.${entry}
set e [entry $w.e$entry]
$e insert end ${top}.${entry}
pack $e -fill x -expand yes
update idletask
}
update
}
set ::alltop $top
set ::stoptop 200
puts "."
puts "finished"
}
Also I experienced weird things that opening/closing files, sockets etc sometimes reduces the number of entries even more (unfort. not reproducable).
Note: The handles, threads, GID in the windows task-manager is still very low.
thx
serhiy.storchakawiki2026-10-12 17:31:50
Duplicate of Tk ticket 742773, see also 31085d2747. Every mapped Tk widget uses one window handle on Windows, and a process is limited to 10000 USER handles by default (USERProcessHandleQuota in the registry); 192 toplevels with 50 entries each is about that many.
Tk does not check whether CreateWindowEx() succeeded, so after the
quota is exhausted it continues with NULL window handles. Nothing is drawn and no
error is reported, and drawing on a NULL handle can go to the whole screen,
which explains the entry drawn outside the toplevel.
serhiy.storchaka Ticket [3461049fff]: 3 changes
[History diff]2026-10-22 17:19:24
Log in (anonymous is fine) to add a comment.