Tcl Source Code

View Ticket
Login
Ticket UUID: 1449383
Title: Memory leak in Thread
Type: Bug Version: obsolete: 8.4.13
Submitter: dharan Created on: 2006-03-14 06:57:47
Subsystem: 80. Thread Package Assigned To: vasiljevic
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2006-04-04 16:33:59
Resolution: Wont Fix Closed By: vasiljevic
    Closed on: 2006-03-14 21:00:35
Description:
Hi,
       I have found a memory leak problem while using 
the TCL thread package. The Tcl version is 8.4.13 and 
Thread version is 2.6.2. I have also attached a sample 
script to support my findings. The sample script 
creates & releases 5 threads for 14 times . For each 
time , the memory of the tclsh process increases by 
700 kb(avg). I have traced the memory through Windows 
Task Manager. 

please forgive me if I had done anything wrong.

OS version : windows 2000

Thanks in Advance.

Gangadharan.
User Comments: nobody added on 2006-04-04 16:33:59:
Logged In: NO 

In the sample script which had been attached, I had used 
the API ::thread::release to release the Tthraed. 

please let me know if the Sample Script requires any other 
steps to free the Thread.

vasiljevic added on 2006-03-15 04:00:34:
Logged In: YES 
user_id=95086

This is no leak. It is the fact that you are posting async scripts to a thread
which has already exited. Such are kept in the Tcl event queue and remain
stucked there forever. For such cases I have made the "reserve/release" 
wrappers. So you basically reserve the thread when you need it and then 
release it when not (the last releaser garbage-collects the thread). This way
you are sure the thread will not be destroyed by somebody else until you
are using it.

dharan added on 2006-03-14 13:57:47:

File Added - 170830: SampleTestuite2.itcl

Attachments: