I've been using DBD::Pg for a system I have made which makes use of
large blobs stored in PostgreSQL databases. Very soon it became very
clear that this leads to massive memory leakage. I traced it down to
DBD::Pg and found an unofficial patch that solved the problem some time ago.
As far as I can see this problem still persists in the recent DBD::Pg
sources, so I figured I would try to submit the fix here hoping that it
would get included in the official sources.
As you can see from the attached diff it merely comments out a couple of
allocations, which probably shouldn't be there. Please note that I am
not the original author that figured this out, I've just been using this
patch on production servers which then work without any leakage.
Please also note that the version referenced as "1.50" in the diff is
just my local modified version.
--- DBD-Pg-1.49/quote.c 2006-04-20 22:55:55.000000000 +0200
+++ DBD-Pg-1.50/quote.c 2006-12-29 06:09:39.000000000 +0100
@@ -305,7 +305,7 @@
if (NULL == string)
- New(0, result, strlen((char *)string)+1, unsigned char);
+ /*New(0, result, strlen((char *)string)+1, unsigned char);*/
result = string;
@@ -334,7 +334,7 @@
result = '\0';
- Renew(result, (*retlen), unsigned char);
+ /*Renew(result, (*retlen), unsigned char);*/
string = result - (*retlen);