Re: memory leak regression 9.1 versus 8.1 - Mailing list pgsql-hackers

From Joe Conway
Subject Re: memory leak regression 9.1 versus 8.1
Date
Msg-id 4FAB2991.7050409@joeconway.com
Whole thread Raw
In response to Re: memory leak regression 9.1 versus 8.1  (Joe Conway <mail@joeconway.com>)
Responses Re: memory leak regression 9.1 versus 8.1
List pgsql-hackers
On 05/09/2012 05:06 PM, Joe Conway wrote:
> OK, new script. This more faithfully represents the real life scenario,
> and reproduces the issue on HEAD with out-of-the-box config settings,
> versus 8.1 which completes the query having never exceeded a very modest
> memory usage:
>
> ---------------
> On pg 8.1 with out of the box config:
> VIRT  RES  SHR
> 199m  11m 3032
> ---------------
> On pg head with out of the box config:
> VIRT  RES  SHR
> 1671m 1.5g  16m
> ---------------

The attached one-liner seems to plug up the majority (although not quite
all) of the leakage.

do_convert_tuple() is allocating a new tuple for every row in the loop
and exec_stmt_return_next() is leaking it.

The query now finishes successfully. On pg head with attached patch and
out of the box config:
VIRT  RES  SHR
196m  35m  31m

This look sane/correct?

Joe

--
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support

Attachment

pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: synchronous_commit and remote_write
Next
From: Josh Berkus
Date:
Subject: Re: unite recovery.conf and postgresql.conf