Re: Memory leaks when fetching array columns

Greg Sabino Mullane <[email protected]> Tue, 4 Nov 2014 10:32:42 -0500
Newsgroups gmane.comp.db.postgresql.dbdpg
Message-ID <[email protected]>
On Sun, Nov 02, 2014 at 07:07:47PM +0000, Krystian Samp wrote:
> Below is a small test case demonstrating the issue.

Thank you for the report and test case. I modified it a hair 
and added to the repo in the testme.tmp.pl file, and was 
able to verify the leak. I made a small change in commit 
36463bd3e72c0f274488be2cbdde61365335b
that fixes it some - we now only leak 6 SVs per round. I will 
take a closer look when I am fully caffeinated and my mind 
is clear, as XS mortalization is a real bugbear. If anyone 
else wants to take a look, the problem is somewhere in 
pg_destringify_array function inside of dbdimp.c

I verified that the problem is in that block by setting:

$dbh->{pg_expand_array} = 0;

If that is set, no leak is seen in the test case.


-- 
Greg Sabino Mullane [email protected]
End Point Corporation
PGP Key: 0x14964AC8
signature.asc (application/pgp-signature, 163 B)
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAlRY8ZoACgkQvJuQZxSWSsiatgCfTL9K+CLOXkeTjo+E5Ab165eu
H0IAoIrY7aJ/upwm0N0JetvvTTLwR1yi
=k8gv
-----END PGP SIGNATURE-----