Overview
| Artifact ID: | 48b46b4bc3602d9bf2e1d4933ec04b5c630027b3d3cd654d061f2d05d1899d6b |
|---|---|
| Ticket: | 5ee1a650b7b537514162f3d9ce01317298ed45f5
Memory usage degradations after enabling thread in TCL |
| User & Date: | sebres on 2021-04-08 10:50:25 |
Changes
- icomment:
What are you calling memory degradation? 1. If you rather mean that freed memory blocks are not released to system back, then it is indeed correct with threaded-alloc, but it is intended behavior - they will be put into common thread pool, so are reusable for further threads. The "solution" is here only to build tcl with some custom memory manager (or redefine Tcl_Alloc, Tcl_Free etc as sys-calls alloc, free etc). 2. If you mean either certain memory fragmentation (e. g. like described here [http://paste.tclers.tk/5260|http://paste.tclers.tk/5260]), then it is also known issue and work is in progress (I'll try to present new threaded-alloc memory manager soon). Possible "solution" for that at the moment is the same as above. 3. And last but not least, some of your handling could be probably thread unsafe, so simply leaking on memory if something used multi-threaded. For instance, you cannot share tcl-objects across threads (it is only allowed to supply single reference of object from one thread to another, but not a common shared usage in both, see Tcl_DuplicateObj), let alone the tcl-interpreter or some other main Tcls instances, which must be also definitely owned by the single thread only.
- login: "sebres"
- mimetype: "text/x-fossil-wiki"