Artifacts Associated With Ticket 617588ffffffffff
Ticket change [1e77b13af5] (rid 90982) by karel_janacek on 2002-10-02 14:48:03:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- 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 - foundin initialized to: "obsolete: 8.4.0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "karel_janacek"
- subsystem initialized to: "41. Memory Allocation"
- title initialized to: "memory leak"
- type initialized to: "Bug"
Ticket change [989993bad6] (rid 110635) by hobbs on 2002-10-11 05:06:44:
- closedate changed to: "2002-10-10T22:06:44"
- closer changed to: "hobbs"
- 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.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "hobbs"