Skip to content
Tcl Source Code History Of Ticket 218681
Login

History Of Ticket 218681

Artifacts Associated With Ticket 218681

  1. Ticket change [1e6ea7c29c] (rid 90976) by nobody on 2000-10-26 01:04:04:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 1727 Bug
      Version: 8.0p2
      SubmitDate: '1999-04-05'
      LastModified: '1999-09-16'
      Severity: MED
      Status: Released
      Submitter: pat
      ChangedBy: hobbs
      OS: All
      OSVersion: NA
      Machine: NA
      FixedDate: '1999-09-16'
      FixedInVersion: 8.2
      ClosedDate: '2000-10-25'
      
      
      Name:  Mark Falco
      email:  [email protected]
      Support:  None
      Severity:  3
      OperatingSystem:  Windows NT
      Synopsis:  there is a memory leak when an empty array is created in a procedure
      
      ReproducibleScript:
          proc abc {} {
            array set tmp {}
          }
          
          while [expr 1] {
             abc
          }
          
          #watch the memory usage, it skyrockets
          
      
      ObservedBehavior:
          in normal application this is just a slow memory leak over time
          
      
      DesiredBehavior:
          no memory leak
          
      
      Patch:
      here is a tcl script which I'm using to fix the behavior.
      
      rename array array_tcl
      
      proc array {args} {  
          if {[llength $args] == 3} {
      if {[lindex $args 0] == {set}} {
          if {[string trim [lindex $args 2]] == {}} {
      #avoid a memory leak in Tcl 8.0, when creating empty arrays
      upvar 1 [lindex $args 1] name
      if ![info exists name] {
          set name() {}
          unset name()
      }
      return
          }
      }
          }
          uplevel 1 array_tcl $args
      }
      
      8.2 shows no noticable signs of mem leak in this proc. 
      -- 09/16/1999 hobbs
      
    4. foundin initialized to: "obsolete: 8.0p2"
    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: "69. Other"
    10. title initialized to:
      there is a memory leak when an empty array is created in a p
      
    11. type initialized to: "Bug"
  2. Ticket change [9858ff664a] (rid 110587) by welch on 2000-10-26 08:27:10:

    1. closedate changed to: "2000-10-26T01:27:10"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [cd31fe804d] (rid 95846) by dgp on 2001-04-16 20:28:08:

    1. subsystem changed to: "07. Variables"
  4. Ticket change [67a5a90af5] (rid 102920) by dgp on 2001-04-16 20:28:09:

    1. closedate changed to: "2001-04-16T13:28:09"
    2. closer changed to: "dgp"