Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1e77b13af56cd87b66fe6561d34f5ac13809abda
Ticket: 617588ffffffffffffffffffffffffffffffffff
memory leak
User & Date: karel_janacek on 2002-10-02 14:48:03
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed 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 changed to: "obsolete: 8.4.0"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "karel_janacek"
  9. subsystem changed to: "41. Memory Allocation"
  10. title changed to: "memory leak"
  11. type changed to: "Bug"