Skip site navigation (1) Skip section navigation (2)

Re: BUG #6365: Memory leak in insert and update

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: havasvolgyi(dot)otto(at)gmail(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6365: Memory leak in insert and update
Date: 2011-12-29 21:49:56
Message-ID: CAHyXU0zD6OJcWwB2MgQjQ2z9fnz=7iBH65AYy3US9F9r9M4ovQ@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Thu, Dec 29, 2011 at 2:10 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> havasvolgyi(dot)otto(at)gmail(dot)com writes:
>> The following bug has been logged on the website:
>> Bug reference:      6365
>> Logged by:          Otto Havasvölgyi
>> Email address:      havasvolgyi(dot)otto(at)gmail(dot)com
>> PostgreSQL version: 9.1.2
>> Operating system:   Win XP SP2 x86; Linux Debian 2.6.32 kernel x64
>> Description:
>
>> The bug can be reproduced with pgbench:
>
> I see no memory leak with this example.
>
> I suspect you are being fooled by tools that report shared memory as
> being used by a process only after it first touches a given page of
> shared memory ("top" on Linux does that, for example).  This will cause
> the apparent memory consumption of any long-lived backend to increase
> until it has touched every available shared buffer.  But that's not a
> leak, just an artifact of the reporting tool.  You can confirm for
> yourself that that's what's happening by reducing shared_buffers to
> a few megabytes and observing that reported memory usage increases up
> to that much and then stops growing.
>
> On Linux, I find that watching the "VIRT" column of top output is a
> far more reliable guide to whether a memory leak is actually occuring.
> Can't offer any suggestions as to what to use on Windows.

This is by the way a FAQ:
http://wiki.postgresql.org/wiki/FAQ#Why_does_PostgreSQL_use_so_much_memory.3F

merlin

In response to

Responses

pgsql-bugs by date

Next:From: Merlin MoncureDate: 2011-12-29 21:57:51
Subject: Re: with hold cursor, cause function execute twice and wrong result
Previous:From: Tom LaneDate: 2011-12-29 20:10:17
Subject: Re: BUG #6365: Memory leak in insert and update

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group