Re: Out of Memory errors are frustrating as heck! - Mailing list pgsql-performance

From Justin Pryzby
Subject Re: Out of Memory errors are frustrating as heck!
Date
Msg-id 20190421101908.GC14223@telsasoft.com
Whole thread Raw
In response to Re: Out of Memory errors are frustrating as heck!  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-performance
I was able to reproduce in a somewhat contrived way:

sh -c 'ulimit -v 1024000 ; /usr/local/pgsql/bin/postgres -D ./pg12dev5 -cport=1234' &

postgres=# SET work_mem='64kB';SET client_min_messages =debug1;SET log_statement_stats=on;explain(analyze) WITH v AS
MATERIALIZED(SELECT * FROM generate_series(1,9999999)i WHERE i%10<10 AND i%11<11 AND i%12<12 AND i%13<13 AND i%14<14
ANDi%15<15 AND i%16<16 AND i%17<17 AND i%18<18 AND i%19<19 AND i%20<20 AND i%21<21 ) SELECT * FROM
generate_series(1,99)kJOIN v ON k=i;
 

        HashTableContext: 8192 total in 1 blocks; 7696 free (7 chunks); 496 used
          hash batch files: 852065104 total in 101318 blocks; 951896 free (20 chunks); 851113208 used
          HashBatchContext: 73888 total in 4 blocks; 24280 free (6 chunks); 49608 used

2019-04-21 04:11:02.521 CDT [4156] ERROR:  out of memory
2019-04-21 04:11:02.521 CDT [4156] DETAIL:  Failed on request of size 8264 in memory context "hash batch files".



pgsql-performance by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: Out of Memory errors are frustrating as heck!
Next
From: Tomas Vondra
Date:
Subject: Re: Out of Memory errors are frustrating as heck!