Overview
| Artifact ID: | 64708928c7c4bdd0be87c182d6990aca409b8705 |
|---|---|
| Ticket: | 1706058fffffffffffffffffffffffffffffffff
Possible Memory Leak (with Threads?) |
| User & Date: | rkeene on 2007-04-23 18:14:10 |
Changes
- assignee changed to: "hobbs"
- cmimetype changed to: "text/plain"
- comment changed to:
#! /home/rkeene/devel/spamgateway/work/tcl8.4.14/INST/bin/tclsh8.4 # This seems to leak memory if I do: # for i in `seq 1 3000`; do telnet localhost 8931 & done # The more times I run the above loop, the larger the "RES" section for the process under "top" becomes. package require Thread 2.6.5 set workers_idx 0 for {set i 0} {$i < 20} {incr i} { lappend workers [thread::create { proc HandleConnection_worker {sock addr port} { close $sock } thread::wait }] } proc HandleConnection {sock addr port} { after idle [list _HandleConnection $sock $addr $port] } proc _HandleConnection {sock addr port} { set tid [lindex $::workers $::workers_idx] set ::workers_idx [expr ($::workers_idx + 1) % [llength $::workers]] thread::transfer $tid $sock thread::send -async $tid [list HandleConnection_worker $sock $addr $port] } socket -server HandleConnection 8931 thread::wait - foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "rkeene"
- subsystem changed to: "41. Memory Allocation"
- title changed to: "Possible Memory Leak (with Threads?)"
- type changed to: "Bug"