Re: Out of memory on SELECT (from sort?) in 8.3 - Mailing list pgsql-general

From Tom Lane
Subject Re: Out of memory on SELECT (from sort?) in 8.3
Date
Msg-id 9515.1221526861@sss.pgh.pa.us
Whole thread Raw
In response to Re: Out of memory on SELECT (from sort?) in 8.3  ("Matt Magoffin" <postgresql.org@msqr.us>)
Responses Re: Out of memory on SELECT (from sort?) in 8.3  ("Matt Magoffin" <postgresql.org@msqr.us>)
List pgsql-general
"Matt Magoffin" <postgresql.org@msqr.us> writes:
>> Is this particular query using xml features, and if so which?  Actually,
>> could you just show us the whole query and the schemas of the tables
>> it's using?

> No, other than returning a column of type xml.

Huh, I was overthinking the problem.  xml_out has a memory leak :-(

More than one in fact: a large leak (equal to size of output) in
the executor context (hence query lifespan) and a small one in
LibxmlContext (hence transaction lifespan).

Try the patch here:
http://archives.postgresql.org/pgsql-committers/2008-09/msg00159.php

(In the long run it might be better if we didn't run datatype output
functions in a query-lifespan context ...)

            regards, tom lane

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: could not open file "pg_subtrans/0014": Invalid argument
Next
From: "Gregory Williamson"
Date:
Subject: Re: Obfuscated stored procedures (was Re: Oracle andPostgresql)