www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14029] New: dynamic arrays dont free memory when they are


          Issue ID: 14029
           Summary: dynamic arrays dont free memory when they are gone..
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: trivial
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: collerblade gmail.com

Dead D users...

I have run into this problem, its very simple, but im wondering why it isnt
working. Code snipet:

import core.sys.windows.windows;
void main() {
    real[] a;
    while(true) {
        a.length=4096*4096; //alloc a big chunk of mem
        Sleep(1000); //just wait a bit

This code runs out of memory. GC never collects anything. Is that a bug?
Im using DMD 2.066.1
I've tried GC.collect(), GC.minimize() too, but the result is the same.

TY: collerblade

Jan 22 2015