Tcl Library Source Code

View Ticket
Login
2009-03-11
05:15 • Ticket [2680202fff] memory leak status still Open with 1 other change artifact: fb2fa57368 user: andreas_kupries
05:14 • Ticket [2680202fff]: 4 changes artifact: 7aa813e604 user: andreas_kupries
05:02 • Ticket [2680202fff]: 4 changes artifact: d2a0669508 user: mstrhh
03:55 • Ticket [2680202fff]: 4 changes artifact: b98d2912b0 user: andreas_kupries
2009-03-10
20:34 • New ticket [2680202fff]. artifact: bb814d0b75 user: mstrhh

Ticket UUID: 2680202
Title: memory leak
Type: Bug Version: None
Submitter: mstrhh Created on: 2009-03-10 20:34:12
Subsystem: md5 Assigned To: patthoyts
Priority: 5 Medium Severity:
Status: Open Last Modified: 2009-03-11 05:15:46
Resolution: None Closed By:
    Closed on:
Description:
the problem is observed by repeatedly calculating the md5 sum on the files of a (preferrably well filled) directory in an interactive tcl shell and watching the mem size of the process:

foreach n [glob DOWNLOAD/*] {md5::md5 -hex -file $n}

Tested on openSuse 11.0, tcl 8.5.5 md5 2.0.7 (TEA version).

Current workaround: exec md5sum works well so far.

Test session:
strobel@s11:~> tclsh
% package require md5
2.0.7
%  exec ps -p [pid] v
  PID TTY      STAT   TIME  MAJFL   TRS   DRS   RSS %MEM COMMAND
 5935 pts/1    Sl+    0:00      0     3 24260  3716  0.0 tclsh
%  foreach n [glob DOWNLOAD/*] {md5::md5 -hex -file $n}
%  exec ps -p [pid] v
  PID TTY      STAT   TIME  MAJFL   TRS   DRS   RSS %MEM COMMAND
 5935 pts/1    Sl+    0:04      0     3 30104  9656  0.2 tclsh
% foreach n [glob DOWNLOAD/*] {md5::md5 -hex -file $n}
% exec ps -p [pid] v
  PID TTY      STAT   TIME  MAJFL   TRS   DRS   RSS %MEM COMMAND
 5935 pts/1    Rl+    0:08      0     3 36060 15632  0.3 tclsh
%  foreach n [glob DOWNLOAD/*] {md5::md5 -hex -file $n}
%  exec ps -p [pid] v
  PID TTY      STAT   TIME  MAJFL   TRS   DRS   RSS %MEM COMMAND
 5935 pts/1    Sl+    0:12      0     3 42136 21592  0.5 tclsh
%
User Comments: andreas_kupries added on 2009-03-11 05:14:09:
Max, thank you for your help.

The loaded tcllibc indicates that md5 is using the critcl-based md5c accelerator to perform all calculations. Which is also in Tcllib.

The accelerator is written by Jean-Claude Wippler (JCW) per the notes in the comments. However overall author (integrating all pieces) is Pat Thoyts.

I am re-assigning to Pat now for comments from him, and will also send a mail to JCW as well, to see how far his involvement went.

mstrhh added on 2009-03-11 05:02:26:
% info loaded
{/usr/share/tcl/lib/teapot/package/linux-glibc2.3-x86_64/lib/tcllibc0.3.4/Linux-x86_64/tcllibc.so Tcllibc}
% package ifneeded Trf [package present Trf]
package Trf is not present
%

andreas_kupries added on 2009-03-11 03:55:21:
The md5 package in Tcllib can use the binary package 'Trf' to accelerate its operations. For correct diagnosis of the problem it is necessary to know if the accelerator is used or not. To determine this please report the output of the each of the following commands:

   info loaded
   package ifneeded Trf [package present Trf]