Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

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

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. 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)]
        }
    
    
    
     
    
  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: "jbeltz"
  9. subsystem changed to: "42. Memory Preservation"
  10. title changed to: "Memory leak with arrays whose elements are lists"
  11. type changed to: "Bug"