Memory leak in Pl/Python

From: Andrey Zhidenkov <andrey(dot)zhidenkov(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Memory leak in Pl/Python
Date: 2016-06-24 22:41:07
Message-ID: CAJw4d1Xj7HqqWwpsPsPbuVEhjQo49vfW7j3BVaA=GyvWjdW+Hw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have postgresql 9.4.8 on my server and I've noticed always growing
memory when I use plpython. I've made some tests and find a few
situations, when memory leaks. For example, when I call this procedure
many times, I can see an always growing memory:

create or replace
function test() returns bigint as $$

plpy.execute("insert into test(test) values ('test')")

return 1

$$ language plpythonu;

Interestingly, when I use not-modifying data query ('select 1') as
argument of execute(), a leak stops.

How can I fix/avoid this?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2016-06-24 22:43:43 Re: Bug in to_timestamp().
Previous Message Gavin Flower 2016-06-24 22:12:05 Re: Bug in to_timestamp().