|
2025-07-20
| ||
| 12:46 | • Closed ticket [a0df373abd]: memory leak by any package require (trunk and window... artifact: f5e48a4a9d user: sebres | |
| 12:01 | • Ticket [a0df373abd]: 3 changes artifact: 2a71cdb67e user: sebres | |
| 02:21 | • Ticket [a0df373abd]: 3 changes artifact: 1ce8256c64 user: apnadkarni | |
|
2025-07-19
| ||
| 16:44 | • New ticket [a0df373abd]. artifact: faec4db7e8 user: sebres | |
memory leak by any package require (trunk and windows only)
9.1 seemed to get something (windows related) causing a leak by simple package require of any package, so this code shows mem-leak of ca. +11MB (+300% of initial mem-usage) in 30 seconds on windows (but no leak on unix platform):
timerate {interp create i; i eval { package require platform }; interp delete i} 30000
thereby all other branches inclusive 8.6 and 9.0 don't show the leak on windows at all.
What metric are you looking at. I tried to reproduce this (Win10) with 9.1rc0 and don't see any of the memory usage related values in process monitor and task manager grow at all. I checked shared, static and shared without zipfs. Curiously, but not related to the ticket, the build without zipfs generates a couple of hundred thousand page faults while the zipfs builds generate none. I understand zipfs being in memory but still that many page faults in the non-zipfs case is surprising to me.
All my builds are without zipfs (so one'd be able to develop or change sources of tcl-library, without to rebuild zipfs).
And I was not on 9.1rc0 but on current trunk.
Env: gcc 14.2 (MinGW-W64 x86_64-msvcrt-posix-seh)...
How it is build:
mkdir win/Release; cd $_
../configure --disable-zipfs
make tcltest
The issue:
./tcltest <<<'
proc memusage {} { regexp -inline {\d+} [exec wmic process where processid=[pid] get WorkingSetSize] };
puts [memusage];
timerate {
timerate {interp create i; i eval { package require platform }; interp delete i} 3000;
puts [memusage];
} 30000
'
The metric is working set size (but the same would be for private bytes):
7880704
10469376
11571200
12693504
13955072
15065088
16216064
17309696
18522112
19595264
If you'd repeat it for 9.0, you'd see zero increase once the mem-manager buffered area grows to matched size of task (and gets frozen by ca. 9375744).
trunk hasn't a leak built in temp folder (I prepared that for bisect), but definitely showed a leak in my projects folder.
It was something that didn't (re)compiled after update, make clean does the job and fixed it.
So the leak was a 3rd party issue, thus closed.