Skip to content
Tcl Source Code History Of Ticket 617588ffffffffff
Login

History Of Ticket 617588ffffffffff

Artifacts Associated With Ticket 617588ffffffffff

  1. Ticket change [1e77b13af5] (rid 90982) by karel_janacek on 2002-10-02 14:48:03:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Hello,
      I am afraid, we found a memory leak bug.
      We use Linux RH 7.1, Tcl 8.4.0 (8.3.3).
      
      When we run the test script
      
      #!/bin/sh
      #test \
      exec wish8.4 "$0" "$@"
      wm iconify .
      
      global q
      array set ::q {}
      
      bell
      after 5000
      for {set i 0} {$i < 100000} {incr i} {
      set ::q($i) $i
      }
      bell
      after 5000
      array unset ::q
      bell
      after 5000
      exit
      
      
      and inspect the memory using the command "ps xv|grep 
      wish" after each bell
      (not by TCL_MEM_DEBUG), it looks that memory is not 
      deallocated by array unset.
                                                VSZ  RSS
       3901 pts/0    S      0:00    731     2  4689 2752  1.4 
      wish8.4 ./test.tcl
       3901 pts/0    S      0:01    731     2 15821 13896  7.2 
      wish8.4 ./test.tcl
       3901 pts/0    S      0:02    731     2 15561 13636  7.1 
      wish8.4 ./test.tcl
      
      When we change the script (variable -> constant)
      for {set i 0} {$i < 100000} {incr i} {
      set ::q($i) 1
      }
      or (variable -> another variable with constant value)
      set j 1
      for {set i 0} {$i < 100000} {incr i} {
      set ::q($i) $j
      }
      it looks ok.
                                                VSZ  RSS
       3914 pts/0    S      0:00    731     2  4689 2752  1.4 
      wish8.4 ./test.tcl
       3914 pts/0    S      0:01    731     2 11909 9984  5.2 
      wish8.4 ./test.tcl
       3914 pts/0    S      0:01    731     2  4689 2764  1.4 
      wish8.4 ./test.tcl
      
      Next, when we use
      .. [array get ::q]
      memory is not deallocated too.
      
      Sorry fo my english. Best regards.
      Karel Janacek
      
      
    4. foundin initialized to: "obsolete: 8.4.0"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "karel_janacek"
    9. subsystem initialized to: "41. Memory Allocation"
    10. title initialized to: "memory leak"
    11. type initialized to: "Bug"
  2. Ticket change [989993bad6] (rid 110635) by hobbs on 2002-10-11 05:06:44:

    1. closedate changed to: "2002-10-10T22:06:44"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      This is not a memory leak.  Tcl maintains a high-water mark 
      object allocator by default.  Your script is allocating 100,000 
      different objects, which won't be freed completely to the 
      system.  They will instead be reused.  You can check google 
      for more in-depth info on this.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "hobbs"