Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4fb6ba395005dc326969a01cf97200869d4c589f
Ticket: 1464731fffffffffffffffffffffffffffffffff
Memory leak in Thread release
User & Date: nobody on 2006-04-06 00:02:10
Changes

  1. icomment:
    Logged In: NO 
    
    I have written a sample script in which I have provided 
    tcltest package in thread send call. Each thread consumes 
    800KB of memory , but while release only 75KB of memory is 
    released.Please find the sample script below.
    
    package require Thread
    array set ::NewThread {}
    set ::mcount 10
    
    after 4000
    # Program Mem-Usage here is 2260K
    for  {set count 1} {$count < $::mcount} {incr count} {
    
       set ::NewThread($count) [thread::create -joinable { 
    thread::wait }]
       puts "Created Thread NewThread($count):  $::NewThread
    ($count)"
    
       for  {set cnt 1} {$cnt < 100 } {incr cnt} {
          thread::send $::NewThread($count) {
             package require tcltest
             puts "xxxxxxxxxxxxxxhello worldxxxxxxxxxxxxxxxxxx"
          }
       }
    }
    
    after 4000
    # Program Mem-Usage here is 9880K
    for  {set count 1} {$count < $::mcount} {incr count} {
    
       thread::release $::NewThread($count)
       puts "Released Thread NewThread($count) : $::NewThread
    ($count)"
       
       thread::join $::NewThread($count)
       puts "NewThread($count) Thread Terminated"
    
    }
    
    puts "Quiting............"
    # Program Mem-Usage here is 9180K
    after 4000
    
    
    
  2. login: "nobody"
  3. mimetype: "text/plain"
  4. username: "nobody"