Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 65734
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: greg [...] turnstep.com
Requestors: UNERA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.17.2
Fixed in: 2.18.0



Subject: Memory leak if an array is appear in bind-variables.
In attache You can find a test that showes the problem. It leaks 1 or 2 Mb / second on my system. If You comment $dbh->do string it will work without any leaks.
Subject: leak_pg1.t
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use DBI; my $dbh = DBI->connect('dbi:Pg:dbname=Database;host=localhost', login => 'XXXX'); $dbh->do('CREATE TEMPORARY TABLE tbl (id SERIAL PRIMARY KEY, val INTEGER[])'); our $cnt; sub _flush_data { my ($array) = @_; my $sql = sprintf "INSERT INTO tbl (val) VALUES %s", join ",", map '(?)', @$array; $dbh->do($sql, undef, @$array); printf "saved: %d\n", scalar @$array; } while(1) { my @ary; push @ary, [ 0 .. int rand 10] for 0 .. int rand 50; _flush_data(\@ary); }
There are a few bugreports about memory leaks. This, #60863, #63408. Do You think to do anything with these problems?
Fixed in r14774; will be a part of the 2.18.0 release