Re: [tkined] Memory issus in Tcl

From: Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de)
Date: Thu Aug 31 2000 - 09:48:48 MET DST


>>>>> Matthew Krenzer writes:

Matthew> In general, the memory usage is fairly constant (slightly
Matthew> increasing), except that every few hours there is a huge
Matthew> increase in the memory usage. Over one weekend we went from
Matthew> using about 10M to over 50M of memory. I have scoured my
Matthew> code looking for anything that could be guilty of this, but I
Matthew> have met with little sucess.
 
Matthew> Dose anyone have any clue as to what might cause this? Is
Matthew> there any thing I might be doing in TCL that could cause
Matthew> these results? TCL is suposed to handle memory management
Matthew> for me, right? As long as I'm not doing something like
Matthew> creating variable with a timestamp in the name, I shouldn't
Matthew> really be getting a leak like this, right? That leaves me
Matthew> with only the hope that something might be found in the
Matthew> libraries I'm using - like TNM. Are there known issues with
Matthew> using TCL in long running proccess that I should know about?

I usually fix immediately all memory leaks I am aware of. In other
words, there are no known memory leaks in Tmn (only unknown onces).

If you are sure that the problem is not in your script (e.g. it does
not assign variables or create handles for C data structures that are
never unset or released), then the only way to track this down is to
recompile everything with memory debugging enabled (-DTCL_MEM_DEBUG)
and to write out the memory allocation periodically. Once you have the
data, you can do diffs between the memory allocation logs and you will
find out which extension is the source of the problem. The downside of
this approach is (except that you need to recompile the packages) that
enabling the memory debugger may significantly slow down the Tcl
interpreter.

/js

-- 
Juergen Schoenwaelder      Technical University Braunschweig
<schoenw@ibr.cs.tu-bs.de>  Dept. Operating Systems & Computer Networks
Phone: +49 531 391 3289    Bueltenweg 74/75, 38106 Braunschweig, Germany
Fax:   +49 531 391 5936    <URL:http://www.ibr.cs.tu-bs.de/~schoenw/>

-- !! This message is brought to you via the `tkined & scotty' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>. !! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.



This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:53 MET