Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3b2a272902a10afce41090a55dc35a6b55c2500d
Ticket: 2960042fffffffffffffffffffffffffffffffff
high water mark memory not shared for file I/O needs
User & Date: blacksqr on 2010-02-27 08:24:47
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    When a string is converted to a list via the split command, the memory used by the list is never released, even if the list variable is unset, even if the conversion takes place in a procedure with no information returned.
    
    To see the leak, execute the following procedure:
    
    proc listleak {} {
    set line xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    for {set i 0} {$i < 2000000} {incr i} {
    append largeString $line\n
    }
    set largeList [split $largeString \n]
    unset largeString
    unset largeList
    return
    }
    
    ===========================================================================
    
    On my computer:
    
    % exec vmstat
    procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
     r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
     0  0  18844 2134300  11572 433516    0    0    71    25  121  378  7  1 92  1
    % listleak
    % exec vmstat
    procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
     r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
     0  0  18844 1836432  11580 433516    0    0    71    25  121  378  7  1 92  1
    
    A net loss of free memory of 297868 kB.  The memory never comes back until the Tcl interpreter is exited.
    
    ActiveTcl 8.5.8 on Ubuntu Intrepid.
    
  4. foundin changed to: "obsolete: 8.5.8"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "blacksqr"
  10. subsystem changed to: "42. Memory Preservation"
  11. title changed to: "conversion of string to list leaks memory"
  12. type changed to: "Bug"