Re: Running out of memory while making a join - Mailing list pgsql-general

From Tom Lane
Subject Re: Running out of memory while making a join
Date
Msg-id 28666.1352836275@sss.pgh.pa.us
Whole thread Raw
In response to Re: Running out of memory while making a join  (Carlos Henrique Reimer <carlos.reimer@opendb.com.br>)
Responses Re: Running out of memory while making a join  (Carlos Henrique Reimer <carlos.reimer@opendb.com.br>)
List pgsql-general
Carlos Henrique Reimer <carlos.reimer@opendb.com.br> writes:
> That is what I got from gdb:

>       ExecutorState: 11586756656 total in 1391 blocks; 4938408 free (6
> chunks); 11581818248 used

So, query-lifespan memory leak.  After poking at this for a bit, I think
the problem has nothing to do with joins; more likely it's because you
are returning a composite column:

    select wm_nfsp from "5611_isarq".wm_nfsp ...

I found out that record_out() leaks sizable amounts of memory, which
won't be recovered till end of query.  You could work around that by
returning "select wm_nfsp.*" instead, but if you really want the result
in composite-column notation, I'd suggest applying this patch:
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=c027d84c81d5e07e58cd25ea38805d6f1ae4dfcd

            regards, tom lane


pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Enabling Autovacuum Postgres 9.1 (was Unexpectedly high disk space usage)
Next
From: Paul Jungwirth
Date:
Subject: window functions in an UPDATE