Re: memory leaks? using savepoint

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tatsuhito Kasahara <kasahara(dot)tatsuhito(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: memory leaks? using savepoint
Date: 2010-12-22 02:26:26
Message-ID: AANLkTinhr5JedDB5qBs7xdOg35MtZOg7S+BoSmq3tPua@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Dec 17, 2010 at 7:27 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Tatsuhito Kasahara <kasahara(dot)tatsuhito(at)oss(dot)ntt(dot)co(dot)jp> writes:
>> When I tested simple query as following, backend process used much memory
>> and not freed until the backend was finished.
>> # This is reproduced on PostgreSQL8.3 (PostgreSQL8.3.6 - PostgreSQL8.3.12)
>
> Hmm ... this test case doesn't appear to produce any significant memory
> leakage in 8.4 and up.  What is happening in 8.3 is that the
> CurTransactionContext of each subtransaction becomes nonempty, so it
> eats 8K or so even though the snapshot gets released shortly later.
> There are plenty of other ways to cause that to happen, though, so I'm
> not particularly excited about fixing this one ... especially not in a
> stable branch that's not getting a lot of developer testing anymore.
> I'm inclined to leave this alone --- I think the risks of patching only
> an old branch will outweigh the benefits.

The proposed patch looks very simple. I don't think that applying that
patch will cause serious risk.

Unless the bug is fixed, the users who encountered the memory-leak
cannot update their postgres to the latest version of 8.3. This would
cause more serious situation. And, since psqlODBC frequently issues
SAVEPONT and RELEASE SAVEPOINT, this memory-leak is not rare case,
I think.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-12-22 02:48:33 Re: memory leaks? using savepoint
Previous Message Carlo Curatolo 2010-12-21 15:47:03 BUG #5800: "corrupted" error messages (encoding problem ?)