www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20303] New: Memory leak in core.thread

https://issues.dlang.org/show_bug.cgi?id=20303

          Issue ID: 20303
           Summary: Memory leak in core.thread
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: adam.furtenbach gmail.com

Running the following code will continuously leak small bits of memory, 2 GiB
RSS after an hour.

import core.thread;

void main()
{
        void delegate() action = () {};

        while (true)
        {
                auto thread = new Thread(action);

                thread.start().join();
        }
}

--
Oct 16 2019