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

Cauterite <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from Cauterite <[email protected]> ---
I highly suspect this issue has already been resolved.
Here's a simple test:

import core.memory;
void main() {
    // allocate and free lots of 10MB arrays
    foreach (_; 0 .. 1000) {
        auto x = GC.calloc(10_000_000, 1);
        GC.free(x);
        x = null;
    };

    import std.c.stdio;
    printf("done\n"); getchar();
};

if you remove the `GC.free(x)` the working set will grow to >1GB. if you leave
it in, memory usage is normal ~15MB or so.
so the GC is definitely releasing pages back to the OS when it deallocates.

And before you ask, yes I am linking with SNN.lib

--

Reply via email to