Artifacts Associated With Ticket bb9129e46c
Ticket change [f5e7528133] (rid 163745) by luguanhui on 2018-06-04 11:37:16:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Recentely,I build a c++ program with the TCL Interpreter,and spawn 20 threads .In each thread,I write the flowing code in loop : 1.new a TCL Interpreter 2.execute lots of TCL script 3.delete the interpreter 4.call Tcl_FinalizeThread to free the memory After execute the code.the memory is raise up and didn't come down for ever.And the I check the code of TCL8.6.8 ,I found that TCL have two type of memory management:Thread Local Storage memory and shared memory.After Tcl_FinalizeThread is call ,the TLS memroy will transfer to shared memory.and shareed will not free for ever ,and this will lead to TCL Memory raise up and didn't come down for ever My question is : 1.why TCL didn't free the shared memeory for ever 2.Does TCL provide any way to free the share memory - foundin initialized to: "8.6.8"
- is_private initialized to: "0"
- login: "luguanhui"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "luguanhui"
- subsystem initialized to: "- New Builtin Commands"
- title initialized to: "TCL Memory raise up and didn't come down for ever"
- type initialized to: "Bug"
Ticket change [769d407e45] (rid 226565) by dkf on 2024-05-24 08:58:19:
- comment changed to:
Recentely,I build a c++ program with the TCL Interpreter,and spawn 20 threads .In each thread,I write the flowing code in loop : 1. new a TCL Interpreter 2. execute lots of TCL script 3. delete the interpreter 4. call Tcl_FinalizeThread to free the memory After execute the code.the memory is raise up and didn't come down for ever.And the I check the code of TCL8.6.8 ,I found that TCL have two type of memory management:Thread Local Storage memory and shared memory.After Tcl_FinalizeThread is call ,the TLS memroy will transfer to shared memory.and shareed will not free for ever ,and this will lead to TCL Memory raise up and didn't come down for ever My question is : 1.why TCL didn't free the shared memeory for ever 2.Does TCL provide any way to free the share memory
- icomment:
It's a traditional high-water-mark memory allocator (with special arenas for `Tcl_Obj` structures and for the execution stacks), at least for small allocations; large allocations go direct to whatever the system memory allocator is (i.e., `malloc()` on POSIX). Unused memory pages will eventually get paged out by the OS so it's not too serious in normal applications.
- login: "dkf"
- mimetype: "text/x-markdown"
- subsystem changed to: "41. Memory Allocation"
- comment changed to: