Amine wrote:
> How can i 'force' Perl to return the used memory ?
You cannot. This memory is actually free, you can still use it in your program,
as you can see when you run "func" once
again.
Or, as your question partially suggests, use threads: ending a thread will
release the memory back to
- Original Message -
From: "rocku"
To: "Amine"
Cc:
Sent: Friday, July 24, 2009 3:20 PM
Subject: Re: Perl and memory...
> To answer your first question, take a look at Perl's FAQ:
> http://perldoc.perl.org/perlfaq3.html#How-can-I-free-an-array-or-hash-so-my-program-shrinks?
>
Hello,
To answer your first question, take a look at Perl's FAQ:
http://perldoc.perl.org/perlfaq3.html#How-can-I-free-an-array-or-hash-so-my-program-shrinks?
Amine pisze:
> Hi all,
>
> Look at the following script:
> ---
>
> use Thread qw(:DEFAULT async yiel
Hi all,
Look at the following script:
---
use Thread qw(:DEFAULT async yield);
sub func
{
my @b;
for ($i=0;$i<100;$i++)
{ $b[$i] = 'Perl';}
;
undef @b;
print '@b memory returned..';
;
}
@param = ();
my $t = Thread->new(\&func, @param);
$result