From: | Michael Schaap <perl6 [...] mscha.org> |
To: | rakudobug [...] perl.org |
Date: | Fri, 26 May 2017 20:55:29 +0200 |
Subject: | [BUG] error initializing large array on Windows (64-bit) |
The following script:
#!/usr/bin/env perl6
use v6.c;
sub MAIN(Int $n = 20_000_000)
{
say "Starting...";
my int @a = 1..$n;
say "Array initialized.";
sleep 10;
}
fails on my Windows machine:
Unable to allocate an array of 20000000 elements
This is a Windows 10 64-bit machine, running the official 64-bit Rakudo
Star 2017.04.3 build.
The machine has 16 GB of memory, and at the moment, 48% is in use.
When I run the script with n = 15 million, I can see in the task manager
that it's using 162.7 MB, which is not excessive. (Memory used jumps
from 42% to 43%.)
The same script on my Linux server (with a self-built Rakudo Star
2017.04) runs fine, I've tested it up to one billion.