Re: Out of Memory errors are frustrating as heck!

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Gunther <raj(at)gusw(dot)net>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Out of Memory errors are frustrating as heck!
Date: 2019-04-21 10:19:09
Message-ID: 20190421101908.GC14223@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 AND i%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)k JOIN 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".

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tomas Vondra 2019-04-21 11:46:18 Re: Out of Memory errors are frustrating as heck!
Previous Message Justin Pryzby 2019-04-21 08:08:22 Re: Out of Memory errors are frustrating as heck!