Hi all,
Look at the following script:
-----------------------------------------------
use Thread qw(:DEFAULT async yield);
sub func
{
my @b;
for ($i=0;$i<1000000;$i++)
{ $b[$i] = 'Perl';}
<STDIN>;
undef @b;
print '@b memory returned..';
<STDIN>;
}
@param = ();
my $t = Thread->new(\&func, @param);
$result = $t->join;
print "End of thread...\n";
<STDIN>;
--------------------------------------------------
On Windows click on Ctrl-Alt-del and click on Performance to
look at the available memory.
When you will run this script and the line
print "End of thread...\n";
is executed all the memory used will be returned by
Perl.
But when the line 'undef @b' is executed , all the used memory
is not returned. (please look on the Task manager)...
So my question is:
How can i 'force' Perl to return the used memory ?
My second question is this:
Look at the following script:
-----------------------------------------------
sub func
{
my @b;
for ($i=0;$i<1000000;$i++)
{ $b[$i] = 'Perl';}
<STDIN>;
undef @b;
print '@b memory returned..';
<STDIN>;
}
func;
func;
print "end ...\n";
<STDIN>;
------------------------------------------------
When you will run this script , you will see that the
second call to func() does take a lot of time(much more
than the first call) , why ?
Regards,
Amine.
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs