Overview
| Artifact ID: | d13c75859e5dadb2a7f3e5cf52186a539daec6e1 |
|---|---|
| Ticket: | 219213ffffffffffffffffffffffffffffffffff
Memory leak in "info exists array()" |
| User & Date: | nobody on 2000-10-26 05:03:39 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 3851 Bug Version: 8.2.2 SubmitDate: '1999-12-10' LastModified: '1999-12-11' Severity: MED Status: Assigned Submitter: techsupp ChangedBy: hobbs OS: All FixedDate: '2000-10-25' ClosedDate: '2000-10-25' Name: Edwin Diekemper ReproducibleScript: % proc testleak {} { set foo(1) one set foo(2) two for { set idx 0 } { $idx < 200000 } { incr idx } { info exists foo($idx) } } % testleak ObservedBehavior: The size of the process gets very large. $ ps -p 6804 PID TTY TIME COMD 6804 pts/20 0:05 tclsh Before running testleak: $ ls -l /proc/6804 -rw------- 1 user banknet 1622016 Dec 10 14:07 /proc/6804 After running testleak: $ ls -l /proc/6804 -rw------- 1 user banknet 15613952 Dec 10 14:07 /proc/6804 DesiredBehavior: Very little change in the size of the process. I've verified that the growth occurs, but when I run this through purify, it doesn't complain about any memory leaks. It only occurs when the array variable on which you are doing 'info exists' already occurs. -- 12/10/1999 hobbs Found the problem. Each time you do 'info exists' on a known array, it will create the hash entry for the key item if it didn't already exist. This will occur just once for each key, but when you just want to know it exists, that's bad. If you were to set the var following, then it wouldn't take any more mem (except for the length of the value), so you only reach the extreme case of waste in the example above. The comments in the code justifying this were to use existing C functions and maintain compatibility with 7.6 behavior. It looks like the internal C funcs have to be rewritten to prevent this quasi-leak (really a mem waste, no leak). -- 12/11/1999 hobbs - foundin changed to: "obsolete: 8.2.2"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "07. Variables"
- title changed to: "Memory leak in "info exists array()""
- type changed to: "Bug"