Overview
| Artifact ID: | 1cd76cc2d668d4cdc864d4eed2bd9feee975dd93 |
|---|---|
| Ticket: | 1603234fffffffffffffffffffffffffffffffff
Memory leak with thread::transfer |
| User & Date: | nobody on 2006-11-26 15:21:00 |
Changes
- assignee changed to: "vasiljevic"
- cmimetype changed to: "text/plain"
- comment changed to:
I am developing project using Tcl + Thread (BitTorrent tracker). At first I tried to use model where main thread after accepting new connection (using socket -server) transfers connection socket to free thread using thread::transfer. But testing of this model reveals slow memory leak (about 1Mb/5min with requests rate about 100 req/sec). Using Tcl memory debugging (Tcl and Thread built with --enable-symbols=mem) and memory command I found that memory leaks after each thread::transfer call. This observes on latest Tcl/Threads versions as well (tcl8.4.14 and thread2.6.5) compiled on Solaris 9/i386 using GCC 3.3.2. Is this a known issue ? Is thread::transfer requires some extra dealing with transferred filedescriptors before or after transfer ? This is a small test: #!/usr/local/bin/tclsh package require Thread proc transfer {channel} { global tid puts [memory info] thread::transfer $tid $channel thread::send -async $tid "close $channel" } proc accept {channel client_addr client_port} { after idle [list transfer $channel] } set tid [thread::create -joinable thread::wait] socket -server accept 9999 thread::wait Field "current bytes allocated" increased by 32 bytes after each incoming connection. - foundin changed to: "obsolete: 8.4.14"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "80. Thread Package"
- title changed to: "Memory leak with thread::transfer"
- type changed to: "Bug"