in reply to Memory usage double expected
G'day sectokia,
I have Perl v5.36.0 (via Perlbrew) running on Cygwin which is running on Win10. Cygwin and Win10 were both updated in the last 24 hours; so, everything is up-to-date.
I ran your code and got the same results: Devel::Size & Devel::Peek showing 4GB; MSWin showing 8GB.
I changed the size from 2**32 (4GB) to 2**31 (2GB). Devel::Size & Devel::Peek are now showing 2GB, as expected; however, MSWin is still showing 8GB.
In both cases, all of the 8GB was freed when the Perl code completed.
I don't want to jump to any conclusions: I'm sure there would be differences between PerlbrewPerl-Cygwin-MSWin and StrawberryPerl-MSWin. However, it does seem to me that issues are possibly related more to MSWin memory management than Perl itself.
I'd suggest rerunning your code with a variety of sizes; checking Devel::Size, Devel::Peek & MSWin memory values for each.
— Ken
|
---|