Skip to content
Tcl Source Code History Of Ticket 454273ffffffffff
Login

History Of Ticket 454273ffffffffff

Artifacts Associated With Ticket 454273ffffffffff

  1. Ticket change [72d67b7550] (rid 104933) by hemanglavana on 2001-08-22 17:03:34:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      If the expression for regexp command is dynamically
      generated
      during runtime, then it causes a memory leak.  I am
      attaching a simple script to reproduce the problem
      (note that you will have to compile tcl with
      TCL_MEM_DEBUG flag).
      
      Here is the output of running the script on solaris2.6
      platform:
      
      
      godel:48> ./regexp.tcl
      Tcl version: 8.3.3
      ==================
         Total       Total   Current   Current   Maximum  
      Maximum
         Mallocs     Frees   Packets    Bytes    Packets   
      Bytes 
         -------     -----   -------   -------   -------  
      -------
           21494     14706      6788    348516      6874   
      413408  Initial
           21709     14890      6819    353810      6874   
      413408  count 10
           21855     15034      6821    353835      6900   
      413408  count 9
           21999     15178      6821    353835      6902   
      413408  count 8
           22143     15322      6821    353835      6902   
      413408  count 7
           22287     15466      6821    353835      6902   
      413408  count 6
           22475     15643      6832    358217      6902   
      413408  count 5
           22666     15823      6843    362639      6913   
      413408  count 4
           22854     16000      6854    367021      6924   
      413408  count 3
           23042     16177      6865    371403      6935   
      413408  count 2
           23229     16354      6875    375345      6946   
      413408  count 1
      godel:49> 
      
      You will note that the current bytes (4th column)
      remain constant for first five iterations, but
      increases for the remaining iterations. The first 5
      iterations use a constant string.
      
      This looks like a memory leak to me. We are having this
      leak in one of our tcl-based server. If I use "string
      match ..." instead of regexp, the memory leak goes
      away.
      
      Hemang.
      
      
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "hemanglavana"
    9. subsystem initialized to: "None"
    10. title initialized to: "memory leak in regexp (tcl8.3.3)?"
    11. type initialized to: "Bug"
  2. Add attachment "regexp.tcl" [fad7938473] (rid 91955) by hemanglavana on 2001-08-23 00:03:35.

  3. Ticket change [b070354d5f] (rid 97980) by hemanglavana on 2001-08-23 00:03:35:

    1. icomment:
      
      
      File Added - 9851: regexp.tcl
      
      
      
    2. login: "hemanglavana"
    3. mimetype: "text/plain"
    4. username: "hemanglavana"
  4. Ticket change [ae78b2a875] (rid 101642) by hobbs on 2001-08-23 00:41:38:

    1. closedate changed to: "2001-08-22T17:41:38"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      This is not surprising, and it isn't a mem leak.  Tcl 
      caches the most recent *30* regexps per thread in an RE 
      compile cache.  This allows Tcl to save on possible 
      expensive RE compilation.  You should see this number go up 
      until 30 iters have been hit, and then the old REs will get 
      swapped out.  This number is a compiled in constant.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "hobbs"