Re: [GENERAL] memory - Mailing list pgsql-general

From Maarten Boekhold
Subject Re: [GENERAL] memory
Date
Msg-id 38453795.BB81DA89@tibcofinance.com
Whole thread Raw
In response to memory  ("John Henderson" <jrh@is.com.fj>)
List pgsql-general
> isfiji=> explain select * from sessions;
> NOTICE:  QUERY PLAN:
> Seq Scan on sessions  (cost=21330.73 size=371719 width=138)
> EXPLAIN
>
> The query above can access over 250M of memory according to top but dies
> with either a seg fault or the latest, something called
> "calloc: Cannot allocate memory"

I'm not sure, but my guess is: the BE needs to allocate data for over 74
megs (your table data), probably more due to formatting and page alignment
losses. Then it's sending it over either a TCP/IP connection or a UNIX
domain socket, probably another 74 megs to be allocated somewhere in
memory(?) and finally it gets to psql which needs to get yet another 74
megs.

Does this make any sense to the experts?

Maarten

--

Maarten Boekhold, maarten.boekhold@tibcofinance.com
TIBCO Finance Technology Inc.
"Sevilla" Building
Entrada 308
1096 ED Amsterdam, The Netherlands
tel: +31 20 6601000 (direct: +31 20 6601066)
fax: +31 20 6601005
http://www.tibcofinance.com


pgsql-general by date:

Previous
From:
Date:
Subject: book's pdf link
Next
From: Ed Loehr
Date:
Subject: Re: [GENERAL] "FATAL 1: my bits moved right off the end of theworld!"