Skip to content
Tcl Source Code History Of Ticket 1464731fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1464731fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1464731fffffffffffffffffffffffffffffffff

  1. Ticket change [868085e1ae] (rid 131519) by nobody on 2006-04-05 07:23:48:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Hi,
           It seems there is memory leak in Thread release 
      call. I have attched the sample script for 
      Theread "create/release". For each thread release 
      there was around 65KB of memory leak. More over if I 
      provide any package in Thread send call the leak was 
      pretty much high(400KB).So please have look into this 
      issue and suggest me a solution.
      
      OS : Windows 2000
      Thanks,
      Karthik
      Email:[email protected]
      
    4. foundin initialized to: "obsolete: 8.4.13"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "49. Threading"
    10. title initialized to: "Memory leak in Thread release"
    11. type initialized to: "Bug"
  2. Ticket change [8e25c527e9] (rid 120061) by dkf on 2006-04-05 17:30:57:

    1. assignee changed to: "vasiljevic"
    2. subsystem changed to: "80. Thread Package"
  3. Ticket change [4fb6ba3950] (rid 125871) by nobody on 2006-04-06 00:02:10:

    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"
  4. Ticket change [d13fad20d2] (rid 113317) by vasiljevic on 2007-06-30 21:59:39:

    1. closedate changed to: "2007-06-30T14:59:39"
    2. closer changed to: "vasiljevic"
    3. icomment:
      Logged In: YES 
      user_id=95086
      Originator: NO
      
      The problem is that you are creating threads with "-joinable" 
      but you never join them. Instead you "thread::release" them.
      Either skip "-joinable" or use "thread::join" to collect the 
      exiting thread.
      
      I agree that it is not clear when to call what and this has something
      to do with the history. I will try to simplify the API and remove 
      some commands out of it to make it more easier to use. Yet, I will
      have to wait for 3.0 to do that. 
      
      
    4. login: "vasiljevic"
    5. mimetype: "text/plain"
    6. resolution changed to: "Wont Fix"
    7. status changed to: "Closed"
    8. username: "vasiljevic"