To create a large string in memory without the create-then-copy, use:
my $x = chr(0); $x x= 500e6;
Now, when you undef $x, only the original 1 byte constant remains. All the rest is released back to the OS.
In reply to Re^5: Memory management with long running scripts
by BrowserUk
in thread Memory management with long running scripts
by jamesrleu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |