Overview
| Artifact ID: | 1ee1de9552b7189dfdb4157ff6c4268eecc560ab |
|---|---|
| Ticket: | 781746ffffffffffffffffffffffffffffffffff
Memory leak with arrays whose elements are lists |
| User & Date: | jbeltz on 2003-08-01 21:05:59 |
Changes
- assignee changed to: "hobbs"
- cmimetype changed to: "text/plain"
- comment changed to:
This is my first summitted bug report so please forgive any newbie type mistakes. OS: HP-UX 11.0 Problem behavior: We noticed a memory problem with a tcl script which which occurs when accessing a list from an array. It is a very bizarre problem and have narrowed it down to a pretty simple script (See attached script memarrlist). It seems like whenever you use the list from the array directly it causes memory to grow. However if you make a copy of it first using [concat $a($elem)] then it is fine? Run top -s1 in one window, and run the script in another. The script waits in three places. The first is after everything has been initialize. Top should say the size of the program is about 9M. The second is after running through the first loop. This loop makes the copy of the list from the array then uses the copy in the following command. set size [[length $recordList] This doesn't cause the program to grow so top should still say about 9M. The third wait you may never get to before running out of memory. This loop does one of two things both of which cause the program to run out of memory. if { 1 } { set recordLine $a($index) set size [llength $recordLine] } else { set size [llength $a($index)] } - foundin changed to: "obsolete: 8.4.0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "jbeltz"
- subsystem changed to: "42. Memory Preservation"
- title changed to: "Memory leak with arrays whose elements are lists"
- type changed to: "Bug"