Re: [GENERAL] Python interface memory leak?

2001-10-17 Thread Denis Gasparin

At 16/10/01 14.00, you wrote:
Does the python interface leak memory? We are seeing the process grow
with basically every select. Any suggestions on what's going on? There
are no cycles, and a trivial program (basically a loop around a select)
demonstrates the problem.

This is 7.1.2 on RH7.[01].

 Stephen

The python interface stores query datas in memory. If you don't clean such 
datas, the used memory will grow up...

If this is not the case, try the PoPy postgres driver for Python 
(http://popy.sourgeforge.net or 
http://freshmeat.net/redir/popy/8258/url_tgz/PoPy-2.0.7.tar.gz ).

Regards,



Doct. Eng. Denis 
Gasparin [EMAIL PROTECTED]
---
Programmer  System 
Administratorhttp://www.edistar.com
---
  Well alas we've seen it all before
   Knights in armour, days of yore
  The same old fears and the same old crimes
We haven't changed since ancient times

   -- Iron Hand -- Dire Straits --
---


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [GENERAL] Python interface memory leak?

2001-10-17 Thread Stephen Robert Norris

On Wed, 2001-10-17 at 16:56, Denis Gasparin wrote:
 At 16/10/01 14.00, you wrote:
 Does the python interface leak memory? We are seeing the process grow
 with basically every select. Any suggestions on what's going on? There
 are no cycles, and a trivial program (basically a loop around a select)
 demonstrates the problem.
 
 This is 7.1.2 on RH7.[01].
 
  Stephen
 
 The python interface stores query datas in memory. If you don't clean such 
 datas, the used memory will grow up...

Actually, it's a bug. I spent most of today with a co-worker looking for
it. There's a Py_DECREF missing in the fetch routine, which makes it
leak the results of every fetch. Who do I send the (one-line) fix to?

Stephen



msg28184/pgp0.pgp
Description: PGP signature


Re: [GENERAL] Python interface memory leak?

2001-10-17 Thread Tom Lane

Stephen Robert Norris [EMAIL PROTECTED] writes:
 Actually, it's a bug. I spent most of today with a co-worker looking for
 it. There's a Py_DECREF missing in the fetch routine, which makes it
 leak the results of every fetch. Who do I send the (one-line) fix to?

pgsql-patches list.

regards, tom lane

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [GENERAL] Python interface memory leak?

2001-10-16 Thread Keary Suska

Are you disposing the results of each select call? Not being familiar with
Python, as well as not knowing which interface for Python you are using, or
the code used to invoke the selects, I can only surmise that the result data
from each select is being stored in RAM and never garbage collected. At
least that could be responsible for significant memory jumps. For small
jumps, it could simply be the accumulation of multiple objects. So 1) you
may have to explicitly destroy result data and 2) you may need to ensure
that you are re-using the same object.

Without more info, any guess is as good as another.

Keary Suska
Esoteritech, Inc.
Leveraging Open Source for a better Internet

 From: Stephen Robert Norris [EMAIL PROTECTED]
 Date: 16 Oct 2001 22:00:35 +1000
 To: [EMAIL PROTECTED]
 Subject: [GENERAL] Python interface memory leak?
 
 Does the python interface leak memory? We are seeing the process grow
 with basically every select. Any suggestions on what's going on? There
 are no cycles, and a trivial program (basically a loop around a select)
 demonstrates the problem.
 
 This is 7.1.2 on RH7.[01].
 
 Stephen
 


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]