R
rkusenet
Perl 5.6.1 on Linux.
My colleague noticed this in Informix and I noticed it in Sybase.
Here is the relevant code. I am writing this code off my hat
sub memory_problem {
my $sql = "SELECT * FROM SOME BIG TABLE" ;
my $sth = $dbh->prepare($sql);
$sth->execute ;
my $rowdata = $sth->fetchall_arrayref ;
}
Now when this subroutine gets completed, we should expect
all memory associated with variable $rowdata to be released, right?
When I tested the program against Sybase, I saw the memory size
of the program grow from 350K to 18M and then it remained at that,
even when the subroutine was completed.
The memory was never released until the program terminated.
I tested this on Solaris 5.6 against Informix 9.21 by a perl 5.6.0
program and the behaviour is same.
This behaviour is not what I understand of perl garbage collection.
My colleague noticed this in Informix and I noticed it in Sybase.
Here is the relevant code. I am writing this code off my hat
sub memory_problem {
my $sql = "SELECT * FROM SOME BIG TABLE" ;
my $sth = $dbh->prepare($sql);
$sth->execute ;
my $rowdata = $sth->fetchall_arrayref ;
}
Now when this subroutine gets completed, we should expect
all memory associated with variable $rowdata to be released, right?
When I tested the program against Sybase, I saw the memory size
of the program grow from 350K to 18M and then it remained at that,
even when the subroutine was completed.
The memory was never released until the program terminated.
I tested this on Solaris 5.6 against Informix 9.21 by a perl 5.6.0
program and the behaviour is same.
This behaviour is not what I understand of perl garbage collection.