Re: postgres 8.4.9: running out of memory (malloc fails) when running a transaction that runs a LOT of selects - Mailing list pgsql-hackers

From Andres Freund
Subject Re: postgres 8.4.9: running out of memory (malloc fails) when running a transaction that runs a LOT of selects
Date
Msg-id 201207201104.32724.andres@2ndquadrant.com
Whole thread Raw
In response to postgres 8.4.9: running out of memory (malloc fails) when running a transaction that runs a LOT of selects  (Benedikt Grundmann <bgrundmann@janestreet.com>)
Responses Re: postgres 8.4.9: running out of memory (malloc fails) when running a transaction that runs a LOT of selects  (Benedikt Grundmann <bgrundmann@janestreet.com>)
List pgsql-hackers
Hi,

On Friday, July 20, 2012 09:19:31 AM Benedikt Grundmann wrote:
> We yesterday encountered a program that in a degenerate case issued in
> a single transaction a huge number of selects (in a single transaction
> but each select in a separate call to PGExec) (huge = ~ 400,000).
> 
> That transaction would continue to eat memory up until a point where
> calls to malloc (in aset.c) would fail and log for example:
> 
> ,"out of memory","Failed on request of size 11."
Could you show us the different statements youre running in that transaction? 
Are you using any user defined functions, deferred foreign keys, or anything  
like that?

After youve got that "out of memory" message, the log should show a list of 
memory contexts with the amount of memory allocated in each. Could you include 
that in a mail?

Greetings,

Andres
-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: postgres 8.4.9: running out of memory (malloc fails) when running a transaction that runs a LOT of selects
Next
From: Shigeru HANADA
Date:
Subject: Re: pgsql_fdw in contrib