Re: postgres 8.4.9: running out of memory (malloc fails) when running a transaction that runs a LOT of selects

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Benedikt Grundmann <bgrundmann(at)janestreet(dot)com>
Subject: Re: postgres 8.4.9: running out of memory (malloc fails) when running a transaction that runs a LOT of selects
Date: 2012-07-20 09:04:32
Message-ID: 201207201104.32724.andres@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shigeru HANADA 2012-07-20 09:25:20 Re: pgsql_fdw in contrib
Previous Message Heikki Linnakangas 2012-07-20 08:10:48 Re: postgres 8.4.9: running out of memory (malloc fails) when running a transaction that runs a LOT of selects