www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18005] New: AA leak

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

          Issue ID: 18005
           Summary: AA leak
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: temtaime gmail.com

import
                std.stdio,
                std.typecons,
                std.array,
                std.conv,
                std.algorithm,
                std.range;


void main(string[] args)
{
        uint[string] vv;

        foreach(a; 20_000.iota.map!(a => a * 50_000))
        {
                vv[a.to!string] = a;
        }

        uint cnt;

        while(true)
        {
                import core.memory;

                writefln(`%g MB used, %g MB free`, GC.stats.usedSize / 1024f /
1024, GC.stats.freeSize / 1024f / 1024);

                new ubyte[13 * 1024 * 1024];

                GC.collect;
                GC.minimize;

                if(cnt++ == 30) break;
        }
}


On windows:

0.860535 MB used, 4.13947 MB free
13.8644 MB used, 10.6395 MB free
26.8683 MB used, 17.1395 MB free
39.8723 MB used, 23.6395 MB free
52.8762 MB used, 30.1395 MB free
65.8801 MB used, 36.6395 MB free
78.884 MB used, 45.6356 MB free
91.8879 MB used, 57.6317 MB free
104.892 MB used, 72.6277 MB free
117.896 MB used, 59.6238 MB free
130.9 MB used, 77.6199 MB free
143.904 MB used, 64.616 MB free
156.907 MB used, 85.6121 MB free
169.911 MB used, 72.6082 MB free
182.915 MB used, 96.6043 MB free
195.919 MB used, 83.6004 MB free
208.923 MB used, 110.596 MB free
221.927 MB used, 97.5926 MB free
234.931 MB used, 84.5887 MB free
247.935 MB used, 114.585 MB free
260.939 MB used, 101.581 MB free
273.943 MB used, 88.577 MB free
286.946 MB used, 121.573 MB free
299.95 MB used, 108.569 MB free
312.954 MB used, 95.5652 MB free
325.958 MB used, 131.561 MB free
338.962 MB used, 118.557 MB free
351.966 MB used, 105.554 MB free
364.97 MB used, 144.55 MB free
377.974 MB used, 131.546 MB free
390.978 MB used, 118.542 MB free

And on linux:

1.41583 MB used, 3.58417 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free
14.4197 MB used, 10.0842 MB free

--
Nov 22