Memory Leaks in plpgsql in 7.0.2 - Mailing list pgsql-general

From Chris Knight
Subject Memory Leaks in plpgsql in 7.0.2
Date
Msg-id 000d01c00b2d$18ff43f0$020aa8c0@aims.private
Whole thread Raw
Responses Re: Memory Leaks in plpgsql in 7.0.2  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Howdy,

I've sent the following to Jan Weick, but haven't heard a reply. Thought I'd
send it to the list to see if others are having the same problem, and to see
if any Postgres developer reading this list will take ownership for this
problem:

I've found I've had to do a lot of plpgsql rewriting to avoid memory
exhaustion due to calling the functions multiple times in the one session.
Specifically, I've found that huge memory leaks occur when variables are
re-assigned based on a previous value (ie var := var + 1), and also when
strings are concatenated. Worse still is when you use the concatenation to
append to an existing variable.

Careful coding (plus extra memory and swap space!) has allowed us to still
be using Postgres, but it is a bit worrying that plpgsql can't even do
i:=i+1 reliably. It would be nice to know if this could be addressed prior
to the 7.1 release.


Regards,
Chris Knight
Systems Administrator
AIMS Independent Computer Professionals
Tel: +61 3 6334 6664  Fax: +61 3 6331 7032  Mob: +61 419 528 795
Web: http://www.aims.com.au



pgsql-general by date:

Previous
From: Michael Blakeley
Date:
Subject: regex back-references?
Next
From: Tom Lane
Date:
Subject: Re: regex back-references?