From: SourceForge.net <no...@so...> - 2006-11-30 23:33:51
|
Bugs item #1603234, was opened at 2006-11-26 07:21 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1603234&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 80. Thread Package Group: current: 8.4.14 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Zoran Vasiljevic (vasiljevic) Summary: Memory leak with thread::transfer Initial Comment: 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. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-11-30 15:33 Message: Logged In: NO So "current bytes allocated" output by [memory info] doesn't increase after each new connection in your tests ? ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2006-11-30 14:01 Message: Logged In: YES user_id=72656 Originator: NO I am not able to repro this bug using valgrind 3.2.1 on Linux x64. Perhaps it is because it is being properly freed at exit, just not in the interim use? ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-11-26 07:22 Message: Logged In: NO Sorry, I forgot to include a e-mail. My e-mail is ol...@vs.... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1603234&group_id=10894 |