I have some problem with Tcl_DeleteInterp() API (on solaris). I have used this Tcl_DeleteInterp() in my application to delete interpreter. The strange thing i found is the process which uses this API hangs about 20 minutes. I attached the process with truss command and found that the process continuously executing the below functions for almost 20 min for almost 13000(~) times.

15.6541  0.0002 -> libtcl8.4:Tcl_DeleteInterp(0x41748, 0x0, 0x0, 0x0)
15.6580  0.0039   -> libc:free(0x288f8, 0x0, 0x0, 0x0)
15.6583  0.0003   -> libc:mutex_unlock(0xff0424e8, 0x0, 0x0, 0x0)
15.6584  0.0001   <- libc:free() = 0
15.6588  0.0004   -> libc:free(0x474b0, 0x0, 0x0, 0x0)*
...
...
I have also attached the process with truss command when creating the Tcl Interpreter, but there were only about 800 times malloc() function has been called from Tcl_CreateInterp().

Can someone help me on this why the function Tcl_DeleteInterp calling these functions? I have also checked the implementation done for Tcl_DeleteInterp() , but didn't find any clue.

Thanks