in reply to Re^4: Memory management with long running scripts
in thread Memory management with long running scripts
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Memory management with long running scripts
by AnomalousMonk (Archbishop) on Jul 22, 2012 at 01:45 UTC |