Skip to content
Tcl Source Code History Of Ticket 5ee1a650b7b53751
Login

History Of Ticket 5ee1a650b7b53751

Artifacts Associated With Ticket 5ee1a650b7b53751

  1. Ticket change [5a7bcfc6ca] (rid 193344) by arvind29 on 2021-04-07 17:27:47:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      Memory degradation is happing in few test cases after configuring the TCL with "--enable_thread". So I wanted to know why memory is degrading with "--thread_enable". Please help.
      
    5. foundin initialized to: "8.6.8"
    6. is_private initialized to: "0"
    7. login: "arvind29"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "f31bbee5d57cdca64b0ff5fb39afeb99e5f9c194"
    10. resolution initialized to: "None"
    11. severity initialized to: "Critical"
    12. status initialized to: "Open"
    13. submitter initialized to: "arvind29"
    14. subsystem initialized to: "80. Thread Package"
    15. title initialized to:
       Memory usage degradations after enabling thread in TCL
      
    16. type initialized to: "Bug"
  2. Ticket change [0011d71b2e] (rid 193345) by arvind29 on 2021-04-07 17:29:06:

    1. comment changed to:
      Memory degradation is happing in few test cases after configuring the TCL with "--enable_threads". So I wanted to know why memory is degrading with "--enable-threads". Please help.
      
    2. login: "arvind29"
    3. mimetype: "text/plain"
  3. Ticket change [473f46c1c9] (rid 193360) by arvind29 on 2021-04-08 04:29:40:

    1. login: "arvind29"
    2. mimetype: "text/plain"
    3. priority changed to: "7 High"
  4. Ticket change [48b46b4bc3] (rid 193381) by sebres on 2021-04-08 10:50:25:

    1. 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.
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  5. Ticket change [c214a07f09] (rid 193748) by arvind29 on 2021-04-16 15:04:23:

    1. icomment:
      Hi sebres,
      
      I have removed "#define USE_THREAD_ALLOC 1" from configure file and I have not seen any degradation. Is it safe to remove USE_THREAD_ALLOC from configure file. I am compiling TCL with --enable-threads option.
      
      Thanks much!
      
    2. login: "arvind29"
    3. mimetype: "text/plain"
  6. Ticket change [2f2624a6b6] (rid 193961) by arvind29 on 2021-04-26 10:04:42:

    1. login: "arvind29"
    2. mimetype: "text/plain"
    3. priority changed to: "9 Immediate"
  7. Ticket change [d601218f8c] (rid 258007) by serhiy.storchaka on 2026-10-14 14:19:29:

    1. icomment:
      Yes, it is safe: without USE_THREAD_ALLOC, Tcl 8.6 uses the system malloc() and free(), which are thread-safe, but can be slower when many threads allocate at the same time. As sebres wrote, the threaded allocator keeps freed memory for reuse instead of returning it to the system; this is by design. The fragmentation problem is tracked in [3d1c409f1a].
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Invalid"
    5. status changed to: "Closed"
  8. Ticket change [bcb657a1db] (rid 259914) by serhiy.storchaka on 2026-10-22 17:19:25:

    1. closedate changed to: "2461328.096864699"
    2. closer changed to: "serhiy.storchaka"
    3. login: "serhiy.storchaka"