[Issue 19745] New: Incredible memory consumption for function with huge body

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 16 15:05:13 UTC 2019


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

          Issue ID: 19745
           Summary: Incredible memory consumption for function with huge
                    body
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: kinke at gmx.net

void write(int a) {}

void main()
{
    int a;
    static foreach (i; 1 .. 400_000)
    {
        a = i;
        write(a);
    }
}

On my box with a 64-bit LDC, the process dies due to OOM after some 18 GB.
32-bit DMD dies much sooner obviously. From
https://forum.dlang.org/post/nlhybmioaoxkydicmtjj@forum.dlang.org.

--


More information about the Digitalmars-d-bugs mailing list