Re: BUG #6061: Progresql.exe memory usage using HOLD cursor. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6061: Progresql.exe memory usage using HOLD cursor.
Date
Msg-id 12398.1308156201@sss.pgh.pa.us
Whole thread Raw
In response to BUG #6061: Progresql.exe memory usage using HOLD cursor.  ("Yann" <yann.delorme@esker.fr>)
Responses Re: BUG #6061: Progresql.exe memory usage using HOLD cursor.
List pgsql-bugs
"Yann" <yann.delorme@esker.fr> writes:
> The issue is that in this case all rows are store in memory instead of file
> in the process postgresql.exe

> I think the issue is in the file tuplestore.c.
> When a tuple is added the function static void
> tuplestore_puttuple_common(Tuplestorestate *state, void *tuple), USEMEM is
> not called with tuple size.

Hmm ... yeah, I think there's a leak there.

> I think that, after adding the tuple in the array, a call to USEMEM should
> be done.

No, the callers of tuplestore_puttuple_common are supposed to do that.
But it looks like tuplestore_putvalues() forgot to do so.  So data loads
that go through that particular API would miss incrementing the space
counter.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #6060: does not work -z option of pg_basebackup
Next
From: "Sebastian"
Date:
Subject: BUG #6062: psql terminates on auto-complete