[Issue 19947] New: OutOfMemoryError with GC-allocs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 7 14:46:30 UTC 2019


          Issue ID: 19947
           Summary: OutOfMemoryError with GC-allocs
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: black80 at bk.ru

program bellow crashed

// dmd -m32 -release -O gctest.d
import std, core.memory;
void main() {
    long r = 0; // using results = dont drop code
    for(int i = 0; i < 1000; i++) {
        auto x = new int[10000000];
        r += x.sum();
    write( r );

core.exception.OutOfMemoryError at src\core\exception.d(702): Memory allocation

with -m64 no crashes but prog has more memory than 2GB. 
it cannot be false positive coz array contains all 0s (int.init)
imo something wrong with gc-roots or gc-marks.
code by LDC works fine.


More information about the Digitalmars-d-bugs mailing list