From hugues-vincent.grislin@vif.tm.fr Tue Apr 26 14:04:20 2005 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E6A7453A91 for ; Tue, 26 Apr 2005 11:04:20 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 01409-09 for ; Tue, 26 Apr 2005 14:04:11 +0000 (GMT) Received: from www.vif.tm.fr (vignoninformatic.rain.fr [194.51.37.1]) by svr1.postgresql.org (Postfix) with ESMTP id 3DD0653A8E for ; Tue, 26 Apr 2005 11:04:08 -0300 (ADT) Received: from vif.tm.fr (hugues-vincentg.vif.tm.fr [128.1.1.110]) by www.vif.tm.fr (8.12.11/8.12.10) with ESMTP id j3QE10mb007188 for ; Tue, 26 Apr 2005 16:01:00 +0200 Message-ID: <426E49F9.3010806@vif.tm.fr> Date: Tue, 26 Apr 2005 16:02:33 +0200 From: Hugues-Vincent Grislin Reply-To: hugues-vincent.grislin@vif.tm.fr Organization: V.I.F. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.6) Gecko/20040113 X-Accept-Language: fr, en MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: out of memory Content-Type: multipart/alternative; boundary="------------000902040703020305040908" X-Scanned-By: MIMEDefang 2.48 on 127.0.0.1 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.096 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, HTML_MESSAGE, HTML_TITLE_EMPTY X-Spam-Level: X-Archive-Number: 200504/1207 X-Sequence-Number: 77120 This is a multi-part message in MIME format. --------------000902040703020305040908 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello, I have a problem when i try to execute my request : ERROR: out of memory DETAIL: Failed on request of size 336. (I had execute the " VACCUM" before) It's a SELECT which contains several jointures (simple ones, 1-1). With 5 jointures there is no problem but with 6, i have this error. _config _: Postgres 7.4.7 Linux Redhat 7.0 RAM : 256 Mo swap : 256 Mo I found some threads about that but no answer. Thanks, Hugues-Vincent Grislin. --------------000902040703020305040908 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hello,

I have a problem when i try to execute my request :

ERROR:  out of memory
DETAIL:  Failed on request of size 336.

(I had execute the " VACCUM" before)
It's a SELECT which contains several jointures (simple ones, 1-1).
With 5 jointures there is no problem but with 6, i have this error.

config :
Postgres 7.4.7
Linux Redhat 7.0
RAM : 256 Mo
swap : 256 Mo

I found some threads about that but no answer.
Thanks,

Hugues-Vincent Grislin.
--------------000902040703020305040908-- From smarlowe@g2switchworks.com Tue Apr 26 18:05:55 2005 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A4FD2536A0 for ; Tue, 26 Apr 2005 15:05:55 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71784-02 for ; Tue, 26 Apr 2005 18:05:51 +0000 (GMT) Received: from koolancexeon.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by svr1.postgresql.org (Postfix) with ESMTP id 027335361A for ; Tue, 26 Apr 2005 15:05:50 -0300 (ADT) Received: mail.g2switchworks.com 10.10.1.8 from 10.10.1.37 10.10.1.37 via HTTP with MS-WebStorage 6.5.6944 Received: from state.g2switchworks.com by mail.g2switchworks.com; 26 Apr 2005 13:05:49 -0500 Subject: Re: out of memory From: Scott Marlowe To: hugues-vincent.grislin@vif.tm.fr Cc: pgsql-general@postgresql.org In-Reply-To: <426E49F9.3010806@vif.tm.fr> References: <426E49F9.3010806@vif.tm.fr> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1114538749.13303.1265.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 26 Apr 2005 13:05:49 -0500 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/1212 X-Sequence-Number: 77125 On Tue, 2005-04-26 at 09:02, Hugues-Vincent Grislin wrote: > Hello, > > I have a problem when i try to execute my request : > > ERROR: out of memory > DETAIL: Failed on request of size 336. > > (I had execute the " VACCUM" before) > It's a SELECT which contains several jointures (simple ones, 1-1). > With 5 jointures there is no problem but with 6, i have this error. > > config : > Postgres 7.4.7 > Linux Redhat 7.0 > RAM : 256 Mo > swap : 256 Mo > > I found some threads about that but no answer. > Thanks, Have you analyzed the database? Try that first. If you still get an out of memory error, try setting enable_hashagg off (set enable_hashagg=false;) and then running the same query again and see if it then works. If it does, post the result of explain analyze YOURQUERYHERE If it doesn't post the output of a plain explain, no analyze. From surabhi.ahuja@iiitb.ac.in Wed Mar 15 08:53:51 2006 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 9B77B9DCA08 for ; Wed, 15 Mar 2006 04:53:51 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 52083-07 for ; Wed, 15 Mar 2006 04:53:52 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from box.iiitb.ac.in (box.iiitb.ac.in [164.164.104.139]) by postgresql.org (Postfix) with ESMTP id 0096D9DC98D for ; Wed, 15 Mar 2006 04:53:48 -0400 (AST) Received: by box.iiitb.ac.in (Postfix, from userid 20) id 1DA4EAC4B; Wed, 15 Mar 2006 14:22:55 +0530 (IST) Received: from jal.iiitb.ac.in (jal.iiitb.ac.in [10.100.100.246]) by box.iiitb.ac.in (Postfix) with ESMTP id 0BB61AC48 for ; Wed, 15 Mar 2006 14:22:55 +0530 (IST) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6480E.8DF1E672" Content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Subject: Re: out of memory Date: Wed, 15 Mar 2006 14:25:40 +0530 Message-ID: <8626C1B7EB748940BCDD7596134632BE398665@jal.iiitb.ac.in> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [GENERAL] out of memory thread-index: AcZIAKE3PwQfVPr/Q0eRp0ihcdjn1gADZrsB From: "surabhi.ahuja" Cc: X-yoursite-MailScanner-Information: Please contact the ISP for more information X-yoursite-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-MailScanner-From: surabhi.ahuja@iiitb.ac.in X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.225 required=5 tests=[AWL=0.035, HTML_MESSAGE=0.001, MISSING_HEADERS=0.189] X-Spam-Score: 0.225 X-Spam-Level: X-Archive-Number: 200603/605 X-Sequence-Number: 92470 This is a multi-part message in MIME format. ------_=_NextPart_001_01C6480E.8DF1E672 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable hi=20 i use postgres 8.0.0 i have a test program in c++, which tries to insert rows into the tables = of my database. =20 is there any way that i can check that there are no memory leaks etc = happening. =20 i ran valgrind on my test program that is not showing any mem leak, but are ther any other tools/ etc that i can use to double verufy it. =20 Thanks, regards Surabhi ------_=_NextPart_001_01C6480E.8DF1E672 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =0A= =0A= =0A= =0A= =0A= =0A= Re: [GENERAL] out of memory using Postgres with = Spring/Hibernate/Java=0A= =0A= =0A=
=0A=
hi =
=0A=
i use postgres = 8.0.0
=0A=
i have a test program in c++, which tries = to insert =0A= rows into the tables of my database.
=0A=
 
=0A=
is there any way that i can check that = there are no =0A= memory leaks etc happening.
=0A=
 
=0A=
i ran valgrind on my test program that is = not showing =0A= any mem leak,
=0A=
but are ther any other tools/ etc that i = can use to =0A= double verufy it.
=0A=
 
=0A=
Thanks,
=0A=
regards
=0A=
Surabhi
=0A= =0A= =0A= ------_=_NextPart_001_01C6480E.8DF1E672-- From a.antoniou@albourne.com Wed Mar 15 09:21:15 2006 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BE5789DC8A5 for ; Wed, 15 Mar 2006 05:21:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56554-08 for ; Wed, 15 Mar 2006 05:21:15 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id ED6C89DCB4D for ; Wed, 15 Mar 2006 05:21:10 -0400 (AST) Received: from horro.albourne.com (horro.albourne.com [83.244.142.183]) by svr4.postgresql.org (Postfix) with ESMTP id 211DF5AF02A for ; Wed, 15 Mar 2006 09:21:12 +0000 (GMT) Received: from mailhost.albourne.com (angeln.intern.albourne.com [192.168.160.21]) by horro.albourne.com (8.13.3/8.13.3) with ESMTP id k2F9L0O4022308; Wed, 15 Mar 2006 09:21:00 GMT Received: from localhost ([127.0.0.1]) by mailhost.albourne.com (using TLSv1/SSLv3 with cipher AES256-SHA (256 bits)); Wed, 15 Mar 2006 09:21:00 +0000 Message-ID: <4417DB91.1020807@albourne.com> Date: Wed, 15 Mar 2006 11:17:05 +0200 From: Antonis Antoniou Reply-To: a.antoniou@albourne.com User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "surabhi.ahuja" Cc: pgsql-general@postgresql.org Subject: Re: out of memory References: <8626C1B7EB748940BCDD7596134632BE398665@jal.iiitb.ac.in> In-Reply-To: <8626C1B7EB748940BCDD7596134632BE398665@jal.iiitb.ac.in> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200603/606 X-Sequence-Number: 92471 surabhi.ahuja wrote: >hi >i use postgres 8.0.0 >i have a test program in c++, which tries to insert rows into the tables of my database. > >is there any way that i can check that there are no memory leaks etc happening. > >i ran valgrind on my test program that is not showing any mem leak, >but are ther any other tools/ etc that i can use to double verufy it. > >Thanks, >regards >Surabhi > > > May be you can try using -> http://www.andreasen.org/LeakTracer/ To be honest I have never used it. Many Thanks, Antonis From alex@innovacomputing.com Fri Mar 28 19:04:00 2008 Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id AB3602E0031 for ; Fri, 28 Mar 2008 16:04:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 82051-09 for ; Fri, 28 Mar 2008 16:03:32 -0300 (ADT) X-Greylist: delayed 00:26:37.072025 by SQLgrey-1.7.5 Received: from wh01.wirehydrant.com (wh01.wirehydrant.com [74.86.140.178]) by postgresql.org (Postfix) with ESMTP id C33202E0045 for ; Fri, 28 Mar 2008 16:03:35 -0300 (ADT) Received: from homer.d-oh.org (unknown [10.1.3.36]) by wh01.wirehydrant.com (Postfix) with SMTP id 7B6EEDB48 for ; Fri, 28 Mar 2008 13:36:56 -0500 (CDT) Received: (qmail 28443 invoked from network); 28 Mar 2008 18:36:56 -0000 Received: from unknown (HELO ?127.0.0.1?) (192.168.0.100) by homer.int.d-oh.org with SMTP; 28 Mar 2008 18:36:56 -0000 Message-ID: <47ED3B41.80305@innovacomputing.com> Date: Fri, 28 Mar 2008 13:38:57 -0500 From: Alex Adriaanse User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Out of memory Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200803/1495 X-Sequence-Number: 130817 I have a client that experienced several Out Of Memory errors a few weeks ago (March 10 & 11), and I'd like to figure out the cause. In the logs it's showing that they were getting out of memory errors for about 0.5-1 hour, after which one of the processes would crash and take the whole database down. After they restarted the server it would eventually start giving out of memory messages and crash again. This happened a total of five times over a 24 hour period. After that we did not see these errors again. They did upgrade to 8.1.11 on the 14th, and have also moved some of the databases to different servers afterwards. First some background information: Software (at the time of the memory errors): CentOS 4.5 (x86_64) running its 2.6.9-55.ELsmp Linux kernel, PostgreSQL 8.1.9 (from RPMs provided on the PostgreSQL web site: postgresql-8.1.9-1PGDG.x86_64). Hardware: 4 dual-core Opterons. 16GB physical RAM, 2GB swap. Database: they use persistent connections, and usually have around 1000 open database connections. The vast majority of those are usually idle. They do run a lot of queries though. The total size of the databases in this cluster is 36GB, with the largest database being 21GB, and the largest table being 2.5GB (having 20 million tuples). Highlights of postgresql.conf settings: max_connections = 2000 shared_buffers = 120000 work_mem = 4096 maintenance_work_mem = 268435 max_fsm_pages = 1500000 max_fsm_relations = 2000 checkpoint_segments = 8 effective_cache_size = 1400000 stats_start_collector = on stats_command_string = off stats_block_level = on stats_row_level = on stats_reset_on_server_start = off autovacuum = on lc_* = 'en_US.UTF-8' Note that not all of these settings may have been in effect during the first crash since the server hadn't been restarted for quite some time. However, during the second and third crash these settings were in effect. ulimit settings: core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited pending signals (-i) 1024 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 137216 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited Miscellaneous facts: Before the crashes there were a lot of "duplicate key violates unique constraint ..." errors as well as some syntax errors in some of the queries. A lot of these errors were fixed after the crashes. I don't think these would be related to the problem unless there's a memory leak somewhere. This server does not have any other processes running that could consume a significant amount of memory. Some of the other processes that run are SSH, cupsd, snmpd, sendmail, portsentry, xinetd, and Dell OpenManage. This server has no cronjobs. These errors usually seemed to occur right after autovacuum started vacuuming a database, although I'm not sure if autovacuum is the cause here. Here are some of the relevant portions from the logs (some of the database/relation names are obfuscated to protect confidentiality): 2008-03-10 18:42:58 EDT LOG: autovacuum: processing database "database1" [this database is 4GB in size] TopMemoryContext: 401632 total in 11 blocks; 12832 free (12 chunks); 388800 used TopTransactionContext: 8192 total in 1 blocks; 7352 free (11 chunks); 840 used Operator class cache: 8192 total in 1 blocks; 1680 free (0 chunks); 6512 used Autovacuum context: 253952 total in 5 blocks; 131152 free (147 chunks); 122800 used smgr relation table: 24576 total in 2 blocks; 15968 free (4 chunks); 8608 used Portal hash: 8192 total in 1 blocks; 1680 free (0 chunks); 6512 used PortalMemory: 0 total in 0 blocks; 0 free (0 chunks); 0 used Relcache by OID: 24576 total in 2 blocks; 7632 free (3 chunks); 16944 used CacheMemoryContext: 2157568 total in 10 blocks; 941176 free (0 chunks); 1216392 used some_pkey: 1024 total in 1 blocks; 312 free (0 chunks); 712 used [note: this index is currently about 41MB but only has 129 small tuples - it's currently very bloated] pg_index_indrelid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_constraint_conrelid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_attrdef_adrelid_adnum_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_autovacuum_vacrelid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_database_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_type_typname_nsp_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_type_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_trigger_tgrelid_tgname_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_statistic_relid_att_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_auth_members_member_role_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_auth_members_role_member_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_rewrite_rel_rulename_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_proc_proname_args_nsp_index: 1024 total in 1 blocks; 208 free (0 chunks); 816 used pg_proc_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_operator_oprname_l_r_n_index: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used pg_operator_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_opclass_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_opclass_am_name_nsp_index: 1024 total in 1 blocks; 208 free (0 chunks); 816 used pg_namespace_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_namespace_nspname_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_language_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_language_name_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_inherits_relid_seqno_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_index_indexrelid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_authid_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_authid_rolname_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_database_datname_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_conversion_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_conversion_name_nsp_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_conversion_default_index: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used pg_class_relname_nsp_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_class_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_cast_source_target_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_attribute_relid_attnum_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_attribute_relid_attnam_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_amproc_opc_proc_index: 1024 total in 1 blocks; 208 free (0 chunks); 816 used pg_amop_opr_opc_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_amop_opc_strat_index: 1024 total in 1 blocks; 208 free (0 chunks); 816 used pg_aggregate_fnoid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used Per-database table: 57344 total in 3 blocks; 26096 free (10 chunks); 31248 used Per-database table: 57344 total in 3 blocks; 34320 free (10 chunks); 23024 used Per-database table: 24576 total in 2 blocks; 5696 free (4 chunks); 18880 used Per-database table: 122880 total in 4 blocks; 9344 free (13 chunks); 113536 used Per-database table: 122880 total in 4 blocks; 21680 free (13 chunks); 101200 used Per-database table: 57344 total in 3 blocks; 34320 free (10 chunks); 23024 used Per-database table: 24576 total in 2 blocks; 5696 free (4 chunks); 18880 used Per-database table: 122880 total in 4 blocks; 23744 free (14 chunks); 99136 used Per-database table: 122880 total in 4 blocks; 21680 free (13 chunks); 101200 used Per-database table: 24576 total in 2 blocks; 13920 free (4 chunks); 10656 used Per-database table: 122880 total in 4 blocks; 21680 free (13 chunks); 101200 used Databases hash: 8192 total in 1 blocks; 1680 free (0 chunks); 6512 used MdSmgr: 8192 total in 1 blocks; 7936 free (0 chunks); 256 used LockTable (locallock hash): 24576 total in 2 blocks; 15984 free (5 chunks); 8592 used Timezones: 52560 total in 2 blocks; 3744 free (0 chunks); 48816 used Postmaster: 2328624 total in 3 blocks; 18048 free (86 chunks); 2310576 used ErrorContext: 8192 total in 1 blocks; 8160 free (3 chunks); 32 used 2008-03-10 18:42:58 EDT ERROR: out of memory 2008-03-10 18:42:58 EDT DETAIL: Failed on request of size 274877436. TopMemoryContext: 458976 total in 18 blocks; 12528 free (53 chunks); 446448 used TopTransactionContext: 8192 total in 1 blocks; 7648 free (0 chunks); 544 used SPI Plan: 15360 total in 4 blocks; 584 free (0 chunks); 14776 used SPI Plan: 7168 total in 3 blocks; 952 free (0 chunks); 6216 used SPI Plan: 3072 total in 2 blocks; 1112 free (0 chunks); 1960 used SPI Plan: 3072 total in 2 blocks; 1112 free (0 chunks); 1960 used SPI Plan: 7168 total in 3 blocks; 952 free (0 chunks); 6216 used SPI Plan: 3072 total in 2 blocks; 1576 free (0 chunks); 1496 used SPI Plan: 3072 total in 2 blocks; 1576 free (0 chunks); 1496 used SPI Plan: 3072 total in 2 blocks; 1256 free (0 chunks); 1816 used SPI Plan: 3072 total in 2 blocks; 1192 free (0 chunks); 1880 used SPI Plan: 3072 total in 2 blocks; 1192 free (0 chunks); 1880 used SPI Plan: 3072 total in 2 blocks; 1192 free (0 chunks); 1880 used SPI Plan: 1024 total in 1 blocks; 72 free (0 chunks); 952 used PL/PgSQL function context: 24576 total in 2 blocks; 15096 free (4 chunks); 9480 used SPI Plan: 15360 total in 4 blocks; 776 free (0 chunks); 14584 used SPI Plan: 3072 total in 2 blocks; 1112 free (0 chunks); 1960 used SPI Plan: 3072 total in 2 blocks; 1192 free (0 chunks); 1880 used SPI Plan: 3072 total in 2 blocks; 1192 free (0 chunks); 1880 used SPI Plan: 3072 total in 2 blocks; 1192 free (0 chunks); 1880 used PL/PgSQL function context: 24576 total in 2 blocks; 1024 free (4 chunks); 23552 used SPI Plan: 3072 total in 2 blocks; 1448 free (0 chunks); 1624 used SPI Plan: 7168 total in 3 blocks; 192 free (0 chunks); 6976 used PL/PgSQL function context: 8192 total in 1 blocks; 6016 free (3 chunks); 2176 used SPI Plan: 3072 total in 2 blocks; 1064 free (0 chunks); 2008 used SPI Plan: 3072 total in 2 blocks; 1208 free (0 chunks); 1864 used SPI Plan: 3072 total in 2 blocks; 1712 free (0 chunks); 1360 used SPI Plan: 3072 total in 2 blocks; 1256 free (0 chunks); 1816 used SPI Plan: 3072 total in 2 blocks; 1688 free (0 chunks); 1384 used SPI Plan: 7168 total in 3 blocks; 1952 free (0 chunks); 5216 used SPI Plan: 3072 total in 2 blocks; 1064 free (0 chunks); 2008 used SPI Plan: 3072 total in 2 blocks; 1208 free (0 chunks); 1864 used SPI Plan: 3072 total in 2 blocks; 1208 free (0 chunks); 1864 used SPI Plan: 3072 total in 2 blocks; 1664 free (0 chunks); 1408 used PL/PgSQL function context: 24576 total in 2 blocks; 13080 free (8 chunks); 11496 used SPI Plan: 7168 total in 3 blocks; 4056 free (0 chunks); 3112 used SPI Plan: 3072 total in 2 blocks; 952 free (0 chunks); 2120 used SPI Plan: 3072 total in 2 blocks; 936 free (0 chunks); 2136 used SPI Plan: 3072 total in 2 blocks; 952 free (0 chunks); 2120 used SPI Plan: 3072 total in 2 blocks; 952 free (0 chunks); 2120 used SPI Plan: 3072 total in 2 blocks; 952 free (0 chunks); 2120 used SPI Plan: 7168 total in 3 blocks; 3864 free (0 chunks); 3304 used SPI Plan: 3072 total in 2 blocks; 936 free (0 chunks); 2136 used PL/PgSQL function context: 8192 total in 1 blocks; 896 free (4 chunks); 7296 used Type information cache: 24576 total in 2 blocks; 11888 free (5 chunks); 12688 used SPI Plan: 3072 total in 2 blocks; 352 free (0 chunks); 2720 used PL/PgSQL function context: 8192 total in 1 blocks; 3552 free (6 chunks); 4640 used PLpgSQL function cache: 24224 total in 2 blocks; 3744 free (0 chunks); 20480 used Operator class cache: 8192 total in 1 blocks; 1680 free (0 chunks); 6512 used MessageContext: 1063832 total in 8 blocks; 19088 free (6 chunks); 1044744 used CFuncHash: 8192 total in 1 blocks; 1680 free (0 chunks); 6512 used smgr relation table: 24576 total in 2 blocks; 3584 free (4 chunks); 20992 used Portal hash: 8192 total in 1 blocks; 1680 free (0 chunks); 6512 used PortalMemory: 8192 total in 1 blocks; 8160 free (1 chunks); 32 used Relcache by OID: 24576 total in 2 blocks; 8672 free (3 chunks); 15904 used CacheMemoryContext: 4267376 total in 11 blocks; 1835032 free (1 chunks); 2432344 used [139 user indexes skipped - the biggest item was:187392 total in 25 blocks; 8024 free (0 chunks); 179368 used] pg_index_indrelid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_constraint_conrelid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_attrdef_adrelid_adnum_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_type_typname_nsp_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_type_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_trigger_tgrelid_tgname_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_statistic_relid_att_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_auth_members_member_role_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_auth_members_role_member_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_rewrite_rel_rulename_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_proc_proname_args_nsp_index: 1024 total in 1 blocks; 208 free (0 chunks); 816 used pg_proc_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_operator_oprname_l_r_n_index: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used pg_operator_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_opclass_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_opclass_am_name_nsp_index: 1024 total in 1 blocks; 208 free (0 chunks); 816 used pg_namespace_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_namespace_nspname_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_language_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_language_name_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_inherits_relid_seqno_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_index_indexrelid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_authid_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_authid_rolname_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_database_datname_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_conversion_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_conversion_name_nsp_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_conversion_default_index: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used pg_class_relname_nsp_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_class_oid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used pg_cast_source_target_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_attribute_relid_attnum_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_attribute_relid_attnam_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_amproc_opc_proc_index: 1024 total in 1 blocks; 208 free (0 chunks); 816 used pg_amop_opr_opc_index: 1024 total in 1 blocks; 216 free (0 chunks); 808 used pg_amop_opc_strat_index: 1024 total in 1 blocks; 208 free (0 chunks); 816 used pg_aggregate_fnoid_index: 1024 total in 1 blocks; 312 free (0 chunks); 712 used MdSmgr: 8192 total in 1 blocks; 2208 free (0 chunks); 5984 used LockTable (locallock hash): 24576 total in 2 blocks; 15984 free (5 chunks); 8592 used Timezones: 52560 total in 2 blocks; 3744 free (0 chunks); 48816 used ErrorContext: 8192 total in 1 blocks; 8160 free (3 chunks); 32 used 2008-03-10 18:43:30 EDT ERROR: out of memory 2008-03-10 18:43:30 EDT DETAIL: Failed on request of size 16. [A bunch more memory errors skipped] 2008-03-10 18:43:33 EDT LOG: could not fork new process for connection: Cannot allocate memory 2008-03-10 18:43:33 EDT LOG: could not fork new process for connection: Cannot allocate memory 2008-03-10 18:43:33 EDT LOG: could not fork new process for connection: Cannot allocate memory 2008-03-10 18:43:33 EDT LOG: could not fork new process for connection: Cannot allocate memory [...] 2008-03-10 18:51:08 EDT LOG: archive command "..." failed: return code -1 [...] 2008-03-10 19:20:39 EDT ERROR: out of memory 2008-03-10 19:20:39 EDT DETAIL: Failed on request of size 32. 2008-03-10 19:20:39 EDT LOG: server process (PID 5609) was terminated by signal 11 2008-03-10 19:20:39 EDT LOG: terminating any other active server processes 2008-03-10 19:20:39 EDT WARNING: terminating connection because of crash of another server process 2008-03-10 19:20:39 EDT DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2008-03-10 19:20:39 EDT HINT: In a moment you should be able to reconnect to the database and repeat your command. I also saw the following lines in the kernel logs during this 24 hour period: Mar 10 19:20:39 servername kernel: postmaster[5609]: segfault at 0000007fbffedfe8 rip 000000000049ea35 rsp 0000007fbffedff0 error 6 Mar 10 20:44:15 servername kernel: postmaster[26808]: segfault at 0000007fbffeafe8 rip 000000000049ea00 rsp 0000007fbffeb018 error 6 Mar 11 10:10:59 servername kernel: postmaster[19984]: segfault at fffffffffffffff0 rip 00000000005e7b13 rsp 0000007fbfffe178 error 4 Mar 11 11:52:07 servername kernel: postmaster[27309]: segfault at 0000007fbffedfe8 rip 000000000049ea00 rsp 0000007fbffee018 error 6 Mar 11 12:39:18 servername kernel: postmaster[30301]: segfault at fffffffffffffff0 rip 00000000005e7b13 rsp 0000007fbfffe158 error 4 Each of these five segfaults correspond to when the database crashed. vm.overcommit_memory was set to 0, but I do not see any memory errors in the kernel logs so I don't believe the OOM killer was used. Current output of free: total used free shared buffers cached Mem: 16479276 16441000 38276 0 26612 8633316 -/+ buffers/cache: 7781072 8698204 Swap: 2031608 1180 2030428 The client is using Zenoss to monitor the servers, and it always shows that free memory is pretty low, which tells me that this setup doesn't differentiate memory that's used by the OS buffers/cache, which is unfortunate. I did see free memory going up to about 1GB around each time PostgreSQL crashed, presumably because PostgreSQL got killed and released its memory. Free swap remained at 2GB free before, during, and after the crashes. I did not see any abnormal changes in the loads and CPU utilization during the crashes. Note that these measurements were taking once every other hour so it's not very granular. Any ideas as to what could have caused this? Thank you, Alex From scott.marlowe@gmail.com Fri Mar 28 20:31:07 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DC8CB2E0031 for ; Fri, 28 Mar 2008 17:31:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 26022-08 for ; Fri, 28 Mar 2008 17:31:03 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.176]) by postgresql.org (Postfix) with ESMTP id 69CD62E0030 for ; Fri, 28 Mar 2008 17:31:03 -0300 (ADT) Received: by el-out-1112.google.com with SMTP id z25so290852ele.0 for ; Fri, 28 Mar 2008 13:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=SAUxaLqfLFfOEHSsDZD1ulhCDq6KpokwRWkJRPsZYQc=; b=AA6hfjjpIZu7NdsqUPQ1YupjNWHUEo8h/z/aQ5ikusZ6OjIBvQwAU8uc3QgaebbucDFtWw+Ns+CVpOkS2afQh+xsDFon5Z7C2+ZUwEl9zyKsZgggczAFANhxdH/VyeA7WaQZo44MCwNt/Hm72o+XX5c54dCVs+IgjnCNPu1ZGdM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NCik4ADjKhidLYvrnJW9Y8ahn32zqzIEQ1Q1kJLbn10YMeNi2DcsTYlmBjXOahM6TWZB02vwxiQ/UCQfF5YODfq2uNRxsSNA/1v557oSgEyOTqjghumQItlJgnBfwPkQpRQQsjJ0tySE5Q7Rupe1pmdhv7wTD8k6YoeaCFPSYv0= Received: by 10.114.120.1 with SMTP id s1mr4557234wac.137.1206736261583; Fri, 28 Mar 2008 13:31:01 -0700 (PDT) Received: by 10.114.137.7 with HTTP; Fri, 28 Mar 2008 13:31:01 -0700 (PDT) Message-ID: Date: Fri, 28 Mar 2008 14:31:01 -0600 From: "Scott Marlowe" To: "Alex Adriaanse" Subject: Re: Out of memory Cc: pgsql-general@postgresql.org In-Reply-To: <47ED3B41.80305@innovacomputing.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47ED3B41.80305@innovacomputing.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/1500 X-Sequence-Number: 130822 On Fri, Mar 28, 2008 at 12:38 PM, Alex Adriaanse wrote: > I have a client that experienced several Out Of Memory errors a few > weeks ago (March 10 & 11), and I'd like to figure out the cause. In the > logs it's showing that they were getting out of memory errors for about > 0.5-1 hour, after which one of the processes would crash and take the > whole database down. After they restarted the server it would > eventually start giving out of memory messages and crash again. This > happened a total of five times over a 24 hour period. After that we did > not see these errors again. They did upgrade to 8.1.11 on the 14th, and > have also moved some of the databases to different servers afterwards. > > First some background information: > > Software (at the time of the memory errors): CentOS 4.5 (x86_64) running > its 2.6.9-55.ELsmp Linux kernel, PostgreSQL 8.1.9 (from RPMs provided on > the PostgreSQL web site: postgresql-8.1.9-1PGDG.x86_64). > > Hardware: 4 dual-core Opterons. 16GB physical RAM, 2GB swap. > > Database: they use persistent connections, and usually have around 1000 > open database connections. The vast majority of those are usually > idle. They do run a lot of queries though. The total size of the > databases in this cluster is 36GB, with the largest database being 21GB, > and the largest table being 2.5GB (having 20 million tuples). > > Highlights of postgresql.conf settings: > max_connections = 2000 > shared_buffers = 120000 > work_mem = 4096 SNIP Just because you can set max_connections to 2000 doesn't mean it's a good idea. If your client needs 1000 persistent connections, then put a connection pooler between your app (I'm guessing php since it operates this way) and the database. Running 1000 connections is a LOT, and you need 1000 active connections, then you're likely gonna need a bigger machine than one with 8 cores and 16 gig of rams. OTOH, if you are actively servicing less than 10% of those connections at a time, then you're wasting memory on the number of backends that are started up and doing nothing. each one consumes some amount of memory on its own, usually in the 5 to 10 meg range, just to sit there and do nothing. Plus you've got issues with thundering herd type situations that can show up as you increase connections. Pooling is the answer here. From alex@innovacomputing.com Fri Mar 28 21:18:06 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 130F22E0031 for ; Fri, 28 Mar 2008 18:18:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 41563-03 for ; Fri, 28 Mar 2008 18:18:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from wh01.wirehydrant.com (wh01.wirehydrant.com [74.86.140.178]) by postgresql.org (Postfix) with ESMTP id 7CFC02E0038 for ; Fri, 28 Mar 2008 18:18:03 -0300 (ADT) Received: from homer.d-oh.org (unknown [10.1.3.36]) by wh01.wirehydrant.com (Postfix) with SMTP id AF4A8CD9C for ; Fri, 28 Mar 2008 16:18:01 -0500 (CDT) Received: (qmail 14464 invoked from network); 28 Mar 2008 21:18:00 -0000 Received: from unknown (HELO ?127.0.0.1?) (192.168.0.100) by homer.int.d-oh.org with SMTP; 28 Mar 2008 21:18:00 -0000 Message-ID: <47ED6101.2060907@innovacomputing.com> Date: Fri, 28 Mar 2008 16:20:01 -0500 From: Alex Adriaanse User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Scott Marlowe CC: pgsql-general@postgresql.org Subject: Re: Out of memory References: <47ED3B41.80305@innovacomputing.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/1502 X-Sequence-Number: 130824 Scott Marlowe wrote: > Just because you can set max_connections to 2000 doesn't mean it's a > good idea. If your client needs 1000 persistent connections, then put > a connection pooler between your app (I'm guessing php since it > operates this way) and the database. > > Running 1000 connections is a LOT, and you need 1000 active > connections, then you're likely gonna need a bigger machine than one > with 8 cores and 16 gig of rams. OTOH, if you are actively servicing > less than 10% of those connections at a time, then you're wasting > memory on the number of backends that are started up and doing > nothing. each one consumes some amount of memory on its own, usually > in the 5 to 10 meg range, just to sit there and do nothing. > > Plus you've got issues with thundering herd type situations that can > show up as you increase connections. > > Pooling is the answer here. > Thanks for the suggestion. I fully agree with you, and the client is already making plans to move from persistent connections to connection pooling (they will probably use PgBouncer). I'm just trying to figure out the exact cause of this memory issue so that we can make sure it doesn't happen again, even after they switch to connection pooling. According to my rough calculations, if the server were to max out at 2,000 connections there should still be around 2GB of memory free - unless all of them were running active queries which is doubtful since I did not see unusual changes in the load patterns. And from what I could tell, the server did not tap into swap when PostgreSQL ran out of memory. Thanks, Alex From kleptog@svana.org Fri Mar 28 21:58:31 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1EAC52E0070 for ; Fri, 28 Mar 2008 18:58:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 50778-09 for ; Fri, 28 Mar 2008 18:58:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from svana.org (svana.org [203.190.233.187]) by postgresql.org (Postfix) with ESMTP id 84A172E004E for ; Fri, 28 Mar 2008 18:58:27 -0300 (ADT) Received: from kleptog by svana.org with local (Exim 4.50) id 1JfMaB-0006dw-7a; Sat, 29 Mar 2008 08:57:55 +1100 Date: Fri, 28 Mar 2008 22:57:55 +0100 From: Martijn van Oosterhout To: Alex Adriaanse Cc: pgsql-general@postgresql.org Subject: Re: Out of memory Message-ID: <20080328215755.GF9150@svana.org> Reply-To: Martijn van Oosterhout Mail-Followup-To: Alex Adriaanse , pgsql-general@postgresql.org References: <47ED3B41.80305@innovacomputing.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AjmyJqqohANyBN/e" Content-Disposition: inline In-Reply-To: <47ED3B41.80305@innovacomputing.com> X-PGP-Key-ID: Length=1024; ID=0x6F0B424C X-PGP-Key-Fingerprint: 34A8 8EAC F902 8C8D CA72 DCC7 201E DB34 6F0B 424C User-Agent: Mutt/1.5.9i X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kleptog@svana.org X-SA-Exim-Scanned: No (on svana.org); SAEximRunCond expanded to false X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/1506 X-Sequence-Number: 130828 --AjmyJqqohANyBN/e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 28, 2008 at 01:38:57PM -0500, Alex Adriaanse wrote: > First some background information: >=20 > Software (at the time of the memory errors): CentOS 4.5 (x86_64) running= =20 > its 2.6.9-55.ELsmp Linux kernel, PostgreSQL 8.1.9 (from RPMs provided on= =20 > the PostgreSQL web site: postgresql-8.1.9-1PGDG.x86_64). >=20 > Hardware: 4 dual-core Opterons. 16GB physical RAM, 2GB swap. Since you've clearly disabled overcommit, you should realise that under the default settings you will never use more than about 50-60% of your memory for the database. Your swap will essentially always be unused. The rest will be simply buffers/cache (which may be what you want). You may want to play with the VM settings and/or increase the swap. As for the precise cause of the crash: I don't see anything in the log that would indicate anything unusual, though evidently it wanted about 256MB all of a sudden, which looks suspicously like your maintainence workmem. My guess is that the total allocated VM is fairly close to the limit of your configuration and that a slightly higher than normal load and a background autovacuum took it over the edge. My guess is that if you up the swap to 4GB or perhaps 8GB, you'll get a lot more room to manouver. Does Zenoss track to *allocated* VM in addition to total memory used? Hope this helps, --=20 Martijn van Oosterhout http://svana.org/kleptog/ > Please line up in a tree and maintain the heap invariant while=20 > boarding. Thank you for flying nlogn airlines. --AjmyJqqohANyBN/e Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFH7WnjIB7bNG8LQkwRAv55AJ4h+9AFlbW2TLnqH30e9Lsj4qcMqACghEYr MWL3nR0iH7MGBdSa9RgzEWs= =HOCq -----END PGP SIGNATURE----- --AjmyJqqohANyBN/e-- From tgl@sss.pgh.pa.us Sat Mar 29 00:07:27 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 4ABFD2E004E for ; Fri, 28 Mar 2008 21:07:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 84263-09 for ; Fri, 28 Mar 2008 21:07:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 5C6EA2E0038 for ; Fri, 28 Mar 2008 21:07:21 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m2T07GLn016721; Fri, 28 Mar 2008 20:07:16 -0400 (EDT) To: Martijn van Oosterhout cc: Alex Adriaanse , pgsql-general@postgresql.org Subject: Re: Out of memory In-reply-to: <20080328215755.GF9150@svana.org> References: <47ED3B41.80305@innovacomputing.com> <20080328215755.GF9150@svana.org> Comments: In-reply-to Martijn van Oosterhout message dated "Fri, 28 Mar 2008 22:57:55 +0100" Date: Fri, 28 Mar 2008 20:07:15 -0400 Message-ID: <16720.1206749235@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/1509 X-Sequence-Number: 130831 Martijn van Oosterhout writes: > My guess is that the total allocated VM is fairly close to the limit of > your configuration and that a slightly higher than normal load and a > background autovacuum took it over the edge. My guess is that if you up > the swap to 4GB or perhaps 8GB, you'll get a lot more room to manouver. The bits about > 2008-03-10 18:43:33 EDT LOG: could not fork new process for connection: > Cannot allocate memory certainly suggest that the problem was a global out-of-memory condition and not just within any one process. I concur with raising swap, but also with the upthread suggestions to cut down the number of concurrent connections. The segfaults (sig11s) are a bit disturbing too --- what that probably indicates is someplace using malloc() and failing to test for failure, neither of which is a good thing. Did you by any chance get core dumps from those? A stack trace would be mighty useful. regards, tom lane From alex@innovacomputing.com Sat Mar 29 00:42:21 2008 Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 975062E0038 for ; Fri, 28 Mar 2008 21:42:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 88676-08 for ; Fri, 28 Mar 2008 21:42:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from wh01.wirehydrant.com (wh01.wirehydrant.com [74.86.140.178]) by postgresql.org (Postfix) with ESMTP id 51AF22E0030 for ; Fri, 28 Mar 2008 21:42:11 -0300 (ADT) Received: from homer.d-oh.org (unknown [10.1.3.36]) by wh01.wirehydrant.com (Postfix) with SMTP id 47DC4CD98 for ; Fri, 28 Mar 2008 19:42:09 -0500 (CDT) Received: (qmail 17975 invoked from network); 29 Mar 2008 00:42:07 -0000 Received: from unknown (HELO ?127.0.0.1?) (192.168.0.100) by homer.int.d-oh.org with SMTP; 29 Mar 2008 00:42:07 -0000 Message-ID: <47ED90D8.40807@innovacomputing.com> Date: Fri, 28 Mar 2008 19:44:08 -0500 From: Alex Adriaanse User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Tom Lane CC: Martijn van Oosterhout , pgsql-general@postgresql.org Subject: Re: Out of memory References: <47ED3B41.80305@innovacomputing.com> <20080328215755.GF9150@svana.org> <16720.1206749235@sss.pgh.pa.us> In-Reply-To: <16720.1206749235@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/1513 X-Sequence-Number: 130835 Thanks everyone for the suggestions so far. Tom Lane wrote: > The segfaults (sig11s) are a bit disturbing too --- what that probably > indicates is someplace using malloc() and failing to test for failure, > neither of which is a good thing. Did you by any chance get core dumps > from those? A stack trace would be mighty useful. > Unfortunately, we do not have any core dumps from those. Is there anything else I can provide to make tracing this easier? Could we use the addresses mentioned in the segfault messages for anything useful? Alex From tgl@sss.pgh.pa.us Sat Mar 29 00:51:46 2008 Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 8341E2E0044 for ; Fri, 28 Mar 2008 21:51:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 94750-04 for ; Fri, 28 Mar 2008 21:51:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 729822E004F for ; Fri, 28 Mar 2008 21:51:43 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m2T0pfJi017491; Fri, 28 Mar 2008 20:51:41 -0400 (EDT) To: Alex Adriaanse cc: Martijn van Oosterhout , pgsql-general@postgresql.org Subject: Re: Out of memory In-reply-to: <47ED90D8.40807@innovacomputing.com> References: <47ED3B41.80305@innovacomputing.com> <20080328215755.GF9150@svana.org> <16720.1206749235@sss.pgh.pa.us> <47ED90D8.40807@innovacomputing.com> Comments: In-reply-to Alex Adriaanse message dated "Fri, 28 Mar 2008 19:44:08 -0500" Date: Fri, 28 Mar 2008 20:51:41 -0400 Message-ID: <17490.1206751901@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/1515 X-Sequence-Number: 130837 Alex Adriaanse writes: > Unfortunately, we do not have any core dumps from those. Is there > anything else I can provide to make tracing this easier? Could we use > the addresses mentioned in the segfault messages for anything useful? Hmm, you could try attaching to a running Postgres process with gdb and doing "x/i 0xHEXADDRESS" --- that should at least come up with a routine name, unless your kernel is into address randomization ... regards, tom lane From alex@innovacomputing.com Fri Apr 4 20:24:55 2008 Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 093392E00A8 for ; Fri, 4 Apr 2008 17:24:55 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 87556-01-2 for ; Fri, 4 Apr 2008 17:24:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from wh01.wirehydrant.com (wh01.wirehydrant.com [74.86.140.178]) by developer.postgresql.org (Postfix) with ESMTP id CCEFC2E00AE for ; Fri, 4 Apr 2008 17:24:43 -0300 (ADT) Received: from homer.d-oh.org (unknown [10.1.3.4]) by wh01.wirehydrant.com (Postfix) with SMTP id E6651D3BA for ; Fri, 4 Apr 2008 15:24:40 -0500 (CDT) Received: (qmail 11454 invoked from network); 4 Apr 2008 20:24:39 -0000 Received: from unknown (HELO ?127.0.0.1?) (192.168.0.100) by homer.int.d-oh.org with SMTP; 4 Apr 2008 20:24:39 -0000 Message-ID: <47F68E87.8030906@innovacomputing.com> Date: Fri, 04 Apr 2008 15:24:39 -0500 From: Alex Adriaanse User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Tom Lane CC: Martijn van Oosterhout , pgsql-general@postgresql.org Subject: Re: Out of memory References: <47ED3B41.80305@innovacomputing.com> <20080328215755.GF9150@svana.org> <16720.1206749235@sss.pgh.pa.us> <47ED90D8.40807@innovacomputing.com> <17490.1206751901@sss.pgh.pa.us> In-Reply-To: <17490.1206751901@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/237 X-Sequence-Number: 131206 Tom Lane wrote: > Alex Adriaanse writes: > >> Unfortunately, we do not have any core dumps from those. Is there >> anything else I can provide to make tracing this easier? Could we use >> the addresses mentioned in the segfault messages for anything useful? >> > > Hmm, you could try attaching to a running Postgres process with gdb > and doing "x/i 0xHEXADDRESS" --- that should at least come up with a > routine name, unless your kernel is into address randomization ... > We weren't able to do this on the production server where PostgreSQL crashed, but we did try to recreate as close a setup as possible on another similar server with the same version of PostgreSQL 8.1.9. It is possible that some of the libraries are different or that we're using different binaries of the same version of PostgreSQL. Thus, it might be possible that these particular addresses have shifted due to the different environment and now point to irrelevant instructions. But in case they haven't, here's the output I got: (gdb) x/i 0x000000000049ea35 0x49ea35 : callq 0x562c00 (gdb) x/i 0x000000000049ea00 0x49ea00 : mov %rbx,0xffffffffffffffd0(%rsp) (gdb) x/i 0x00000000005e7b13 0x5e7b13 : mov 0xfffffffffffffff0(%rdi),%rdi I hope this helps. Alex From tgl@sss.pgh.pa.us Fri Apr 4 21:48:59 2008 Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 0AADE2E00A7 for ; Fri, 4 Apr 2008 18:48:59 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 15555-01 for ; Fri, 4 Apr 2008 18:48:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 2FA722E002D for ; Fri, 4 Apr 2008 18:48:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m34Lmn07008862; Fri, 4 Apr 2008 17:48:49 -0400 (EDT) To: Alex Adriaanse cc: Martijn van Oosterhout , pgsql-general@postgresql.org Subject: Re: Out of memory In-reply-to: <47F68E87.8030906@innovacomputing.com> References: <47ED3B41.80305@innovacomputing.com> <20080328215755.GF9150@svana.org> <16720.1206749235@sss.pgh.pa.us> <47ED90D8.40807@innovacomputing.com> <17490.1206751901@sss.pgh.pa.us> <47F68E87.8030906@innovacomputing.com> Comments: In-reply-to Alex Adriaanse message dated "Fri, 04 Apr 2008 15:24:39 -0500" Date: Fri, 04 Apr 2008 17:48:49 -0400 Message-ID: <8861.1207345729@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/245 X-Sequence-Number: 131214 Alex Adriaanse writes: > ... possible that these particular addresses have shifted due to the > different environment and now point to irrelevant instructions. But in > case they haven't, here's the output I got: > (gdb) x/i 0x000000000049ea35 > 0x49ea35 : callq 0x562c00 > (gdb) x/i 0x000000000049ea00 > 0x49ea00 : mov %rbx,0xffffffffffffffd0(%rsp) > (gdb) x/i 0x00000000005e7b13 > 0x5e7b13 : mov 0xfffffffffffffff0(%rdi),%rdi Hmm, not exactly what I was expecting to see. The last one looks like someone passed garbage (maybe a NULL) to pfree; which would be a bug but it's not clear how memory pressure would result in that, and without knowing where pfree was called from we're not going to be able to get far investigating. The first two both seem like they could only be explained by running out of execution stack space. 8.1 takes the max_stack_depth setting you tell it as gospel, so a core dump right there is possible if you set max_stack_depth too large, but you didn't mention having changed it. In any case it's not clear why you'd get a transient spate of problems like that, unless the system was handlng especially (and unreasonably) complicated queries for awhile. Did you query the client about whether their workload could have been unusual during this episode? Of course this is all just speculation since we can't trust the addresses completely. regards, tom lane From JPalmer@linz.govt.nz Fri Mar 25 03:34:39 2011 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 930121337BD5 for ; Fri, 25 Mar 2011 00:34:39 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 38795-04 for ; Fri, 25 Mar 2011 03:34:20 +0000 (UTC) X-Greylist: delayed 00:10:03.713808 by SQLgrey-1.7.6 Received: from smtp.linz.govt.nz (smtp.linz.govt.nz [210.54.54.160]) by mail.postgresql.org (Postfix) with ESMTP id 6DE2B1337990 for ; Fri, 25 Mar 2011 00:33:20 -0300 (ADT) Received: from prdlsmmsg01.ad.linz.govt.nz (Not Verified[127.0.0.1]) by smtp.linz.govt.nz with our Gateway Software id ; Fri, 25 Mar 2011 16:23:13 +1300 Received: from prdlsmmsg01.ad.linz.govt.nz ([127.0.0.1]) by prdlsmmsg01.ad.linz.govt.nz ([127.0.0.1]) with mapi; Fri, 25 Mar 2011 16:23:13 +1300 From: Jeremy Palmer To: "pgsql-general@postgresql.org" Date: Fri, 25 Mar 2011 16:23:13 +1300 Subject: Out of memory Thread-Topic: Out of memory Thread-Index: Acvqm/mGdGEsCXZrSf+OODDlqrr3sQ== Message-ID: <666FB8D75E95AE42965A0E76A5E5337E06DBA892F6@prdlsmmsg01.ad.linz.govt.nz> Accept-Language: en-US, en-NZ X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-NZ MIME-Version: 1.0 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_666FB8D75E95AE42965A0E76A5E5337E06DBA892F6prdlsmmsg01ad_" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.209 tagged_above=-5 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/917 X-Sequence-Number: 174178 --_000_666FB8D75E95AE42965A0E76A5E5337E06DBA892F6prdlsmmsg01ad_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I've been getting database out of memory failures with some queries which= =20deal with a reasonable amount of data. I was wondering what I should be looking at to stop this from happening. The typical messages I been getting are like this: http://pastebin.com/Jx= fu3nYm The OS is: Linux TSTLHAPP01 2.6.32-29-server #58-Ubuntu SMP Fri Feb 11 21:06:51 UTC = 2011 x86_64 GNU/Linux. It's a running on VMWare and, has 2 CPU's and 8GB of RAM. This VM is dedi= cated to PostgreSQL. The main OS parameters I have tuned are: vm.swappiness=3D0 vm.overcommit_memory=3D2 kernel.shmmax =3D 4196769792 kernel.shmall =3D 1024602 And the PostgreSQL is: PostgreSQL 9.0.3 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ub= untu 4.4.3-4ubuntu5) 4.4.3, 64-bit. The main changed psql parameters I've tuned are: shared_buffers =3D 2048MB maintenance_work_mem =3D 512MB work_mem =3D 200MB wal_buffers =3D 16MB effective_cache_size =3D 4094MB I have also try lowering the shared_buffers down to 1GB but it still ran= =20out of memory. Cheers, Jeremy _________________________________________________________________________= _____________________________ This message contains information, which is confidential and may be subje= ct to legal privilege.=20 If you are not the intended recipient, you must not peruse, use, dissemin= ate, distribute or copy this message. If you have received this message in error, please notify us immediately = (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original messag= e. LINZ accepts no responsibility for changes to this email, or for any atta= chments, after its transmission from LINZ. Thank you. _________________________________________________________________________= _____________________________ --_000_666FB8D75E95AE42965A0E76A5E5337E06DBA892F6prdlsmmsg01ad_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I’ve been getting database out of memory failure= s with some queries which deal with a reasonable amount of data.

 

I was wondering what I should be looking at to stop th= is from happening.

 

The typical messages I been getting are like this: http://pastebin.com/Jxfu3nYm

 

The OS is:

 

Linux TSTLHAPP01 2.6.32-29-server #58-Ubuntu SMP Fri F= eb 11 21:06:51 UTC 2011 x86_64 GNU/Linux.

 

It’s a running on VMWare and, has 2 CPU’s = and 8GB of RAM. This VM is dedicated to PostgreSQL. The main OS parameters I = have tuned are:

 

vm.swappiness=3D0

vm.overcommit_memory=3D2

kernel.shmmax =3D 4196769792<= /p>

kernel.shmall =3D 1024602

=

 

And the PostgreSQL is:

 

PostgreSQL 9.0.3 on x86_64-pc-linux-gnu, compiled by G= CC gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5) 4.4.3, 64-bit.

 

The main changed psql parameters I’ve tuned are:=

 

shared_buffers =3D 2048MB

=

maintenance_work_mem =3D 512MB

work_mem =3D 200MB

wal_buffers =3D 16MB

effective_cache_size =3D 4094MB

 

I have also try lowering the shared_buffers  down= =20to 1GB but it still ran out of memory.

 

Cheers,

Jeremy

 

 


This message contains information, which is confidential and may be = subject=20 to legal privilege.
If you are not the intended recipient, you must n= ot=20 peruse, use, disseminate, distribute or copy this message.
If you have= =20 received this message in error, please notify us immediately (Phone 0800 = 665 463=20 or info@linz.govt.nz ) and destr= oy the=20 original message.
LINZ accepts no responsibility for changes to this email, or for any= =20 attachments, after its transmission from LINZ.
 
Thank you.

--_000_666FB8D75E95AE42965A0E76A5E5337E06DBA892F6prdlsmmsg01ad_-- From scott.marlowe@gmail.com Fri Mar 25 04:04:49 2011 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 78F2A1337BBA for ; Fri, 25 Mar 2011 01:04:49 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 53482-03 for ; Fri, 25 Mar 2011 04:04:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iy0-f174.google.com (mail-iy0-f174.google.com [209.85.210.174]) by mail.postgresql.org (Postfix) with ESMTP id 7C1D31337B8B for ; Fri, 25 Mar 2011 01:04:31 -0300 (ADT) Received: by iyb14 with SMTP id 14so96142iyb.19 for ; Thu, 24 Mar 2011 21:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=5hHFJ5QVdTbUiuevuzWDGHZpXimSl7jGFIw4sc3DKtU=; b=K6+8QjkIGJuJuguAmzX1FtoDmx18djj8dLQiHmbwu4t7YeoJ4Uz/qszrkVW8N7L1Le +4NUVbHnCmfOdExd2xAluwMREmQ8CVRHMFtHrBKCdUap4TKmmVkdIpt6w/78sAD4Ctn1 /TPDGKwPRkfrZLOllb3G0cUbCWHjfv5wMpbPc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=p88NhtUTLEMoCkIO4B8DBjBoLjkyXRVd0XmpKobV3tskvQlqQlHSK+57nhoAfaU7zU kUH2vz4w+jrP8BXG1Th5tmGe7YkPtduJgpwJ9B+oF9fM+/hH+gtALDyzm+rbjNXrPkP4 PYw/SrNQOdetvgNEpdwpMu7fdVpawilXMXg4I= MIME-Version: 1.0 Received: by 10.231.142.32 with SMTP id o32mr290637ibu.143.1301025870467; Thu, 24 Mar 2011 21:04:30 -0700 (PDT) Received: by 10.231.159.143 with HTTP; Thu, 24 Mar 2011 21:04:30 -0700 (PDT) In-Reply-To: <666FB8D75E95AE42965A0E76A5E5337E06DBA892F6@prdlsmmsg01.ad.linz.govt.nz> References: <666FB8D75E95AE42965A0E76A5E5337E06DBA892F6@prdlsmmsg01.ad.linz.govt.nz> Date: Thu, 24 Mar 2011 22:04:30 -0600 Message-ID: Subject: Re: Out of memory From: Scott Marlowe To: Jeremy Palmer Cc: "pgsql-general@postgresql.org" Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201103/919 X-Sequence-Number: 174180 On Thu, Mar 24, 2011 at 9:23 PM, Jeremy Palmer wrote= : > I=92ve been getting database out of memory failures with some queries whi= ch > deal with a reasonable amount of data. > > I was wondering what I should be looking at to stop this from happening. > > The typical messages I been getting are like this: > http://pastebin.com/Jxfu3nYm > The OS is: > > Linux TSTLHAPP01 2.6.32-29-server #58-Ubuntu SMP Fri Feb 11 21:06:51 UTC > 2011 x86_64 GNU/Linux. > > It=92s a running on VMWare and, has 2 CPU=92s and 8GB of RAM. This VM is > dedicated to PostgreSQL. The main OS parameters I have tuned are: > > work_mem =3D 200MB That's a really big work_mem. I have mainline db servers with 128G of ram that have work_mem set to 16M and that is still considered a little high in my book. If you drop work_mem down to 1MB does the out of memory go away? work_mem is how much memory EACH sort can use on its own, if you have a plpgsql procedure that keeps running query after query, it could use a LOT of memory really fast. From JPalmer@linz.govt.nz Sat Mar 26 08:57:44 2011 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7D8A61337BD9 for ; Sat, 26 Mar 2011 05:57:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 35825-03 for ; Sat, 26 Mar 2011 08:57:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.linz.govt.nz (smtp.linz.govt.nz [210.54.54.160]) by mail.postgresql.org (Postfix) with ESMTP id 53A901337B80 for ; Sat, 26 Mar 2011 05:57:32 -0300 (ADT) Received: from prdlsmmsg01.ad.linz.govt.nz (Not Verified[127.0.0.1]) by smtp.linz.govt.nz with our Gateway Software id ; Sat, 26 Mar 2011 21:57:26 +1300 Received: from prdlsmmsg01.ad.linz.govt.nz ([127.0.0.1]) by prdlsmmsg01.ad.linz.govt.nz ([127.0.0.1]) with mapi; Sat, 26 Mar 2011 21:57:26 +1300 From: Jeremy Palmer To: Scott Marlowe CC: "pgsql-general@postgresql.org" Date: Sat, 26 Mar 2011 21:57:26 +1300 Subject: Re: Out of memory Thread-Topic: [GENERAL] Out of memory Thread-Index: AcvqocALf9T7ZkI7SDSlpz9d5/r0pgA7/eRc Message-ID: <666FB8D75E95AE42965A0E76A5E5337E06DBA6B78C@prdlsmmsg01.ad.linz.govt.nz> References: <666FB8D75E95AE42965A0E76A5E5337E06DBA892F6@prdlsmmsg01.ad.linz.govt.nz>, In-Reply-To: Accept-Language: en-US, en-NZ X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-NZ MIME-Version: 1.0 Content-Language: en-NZ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/948 X-Sequence-Number: 174209 Hi Scott, It was the work_mem that was set too high. I reduced it to 32mb and the f= unction executed. Just so I understand this. Every time a sort is performed within a functi= on, the sort memory is allocated, and then it not released until the func= tion completes? Rather then deallocating the memory after each sort opera= tion has completed. Thanks, Jeremy=20 ________________________________________ From: Scott Marlowe [scott.marlowe@gmail.com] Sent: Friday, 25 March 2011 5:04 p.m. To: Jeremy Palmer Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Out of memory On Thu, Mar 24, 2011 at 9:23 PM, Jeremy Palmer wro= te: > I=92ve been getting database out of memory failures with some queries w= hich > deal with a reasonable amount of data. > > I was wondering what I should be looking at to stop this from happening= . > > The typical messages I been getting are like this: > http://pastebin.com/Jxfu3nYm > The OS is: > > Linux TSTLHAPP01 2.6.32-29-server #58-Ubuntu SMP Fri Feb 11 21:06:51 UT= C > 2011 x86_64 GNU/Linux. > > It=92s a running on VMWare and, has 2 CPU=92s and 8GB of RAM. This VM i= s > dedicated to PostgreSQL. The main OS parameters I have tuned are: > > work_mem =3D 200MB That's a really big work_mem. I have mainline db servers with 128G of ram that have work_mem set to 16M and that is still considered a little high in my book. If you drop work_mem down to 1MB does the out of memory go away? work_mem is how much memory EACH sort can use on its own, if you have a plpgsql procedure that keeps running query after query, it could use a LOT of memory really fast. _________________________________________________________________________= _____________________________ This message contains information, which is confidential and may be subje= ct to legal privilege.=20 If you are not the intended recipient, you must not peruse, use, dissemin= ate, distribute or copy this message. If you have received this message in error, please notify us immediately = (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original messag= e. LINZ accepts no responsibility for changes to this email, or for any atta= chments, after its transmission from LINZ. Thank you. _________________________________________________________________________= _____________________________ From pasman.p@gmail.com Sat Mar 26 15:47:17 2011 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 848961337BDE for ; Sat, 26 Mar 2011 12:47:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 44008-01 for ; Sat, 26 Mar 2011 15:47:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vx0-f174.google.com (mail-vx0-f174.google.com [209.85.220.174]) by mail.postgresql.org (Postfix) with ESMTP id D53F31337C09 for ; Sat, 26 Mar 2011 12:47:06 -0300 (ADT) Received: by vxi39 with SMTP id 39so1429835vxi.19 for ; Sat, 26 Mar 2011 08:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=K4TfDEmAeyCqWNjHYiUavtjn0c6Pk88IWnyrKRgPTKA=; b=PmNaXNo/ZxEyWmyv14EYj20PwcbiLxhf7yUwF8iBWFMkFXZ90J2rQYdq/z48bRTIxj a9tFPnZR4l2oUVtfUCHIq+92MyytkjXIlR4vzZqbTGJvzko968RbPBWWfKvJm9I04YmQ wAIHC3Zw/DoKZTw7gDI6GQSkEFOIDuR5Bmz8M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MfzdQnFH8/Ce1mj23dnhzEIIb2yhDxFarpYDNIU5rr45Juv8E/rRty76bguCCMlayb QPYNZbXgsEHlMnGz0IRicN0r/932mkG6IKprLugqMYdg4lSsGhSkTHfSpxEHF7rfcpR8 6XuDvjiOGKAlN1If9KQknw2TxxWuoy//QNaUo= MIME-Version: 1.0 Received: by 10.52.99.65 with SMTP id eo1mr1104074vdb.215.1301154130268; Sat, 26 Mar 2011 08:42:10 -0700 (PDT) Received: by 10.220.125.103 with HTTP; Sat, 26 Mar 2011 08:42:10 -0700 (PDT) In-Reply-To: <666FB8D75E95AE42965A0E76A5E5337E06DBA6B78C@prdlsmmsg01.ad.linz.govt.nz> References: <666FB8D75E95AE42965A0E76A5E5337E06DBA892F6@prdlsmmsg01.ad.linz.govt.nz> <666FB8D75E95AE42965A0E76A5E5337E06DBA6B78C@prdlsmmsg01.ad.linz.govt.nz> Date: Sat, 26 Mar 2011 14:42:10 -0100 Message-ID: Subject: Re: Out of memory From: =?ISO-8859-2?Q?pasman_pasma=F1ski?= To: Jeremy Palmer Cc: "pgsql-general@postgresql.org" Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.03 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1.929 X-Spam-Level: X-Archive-Number: 201103/950 X-Sequence-Number: 174211 Hi. Your idea is cool - i think this feature ought to be added to TODO. Sorted rows should be materialized when memory is exhaused, and memory reused. 2011/3/26, Jeremy Palmer : > Hi Scott, > > It was the work_mem that was set too high. I reduced it to 32mb and the > function executed. > > Just so I understand this. Every time a sort is performed within a functi= on, > the sort memory is allocated, and then it not released until the function > completes? Rather then deallocating the memory after each sort operation = has > completed. > > Thanks, > Jeremy > > ________________________________________ > From: Scott Marlowe [scott.marlowe@gmail.com] > Sent: Friday, 25 March 2011 5:04 p.m. > To: Jeremy Palmer > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Out of memory > > On Thu, Mar 24, 2011 at 9:23 PM, Jeremy Palmer wro= te: >> I=92ve been getting database out of memory failures with some queries wh= ich >> deal with a reasonable amount of data. >> >> I was wondering what I should be looking at to stop this from happening. >> >> The typical messages I been getting are like this: >> http://pastebin.com/Jxfu3nYm >> The OS is: >> >> Linux TSTLHAPP01 2.6.32-29-server #58-Ubuntu SMP Fri Feb 11 21:06:51 UTC >> 2011 x86_64 GNU/Linux. >> >> It=92s a running on VMWare and, has 2 CPU=92s and 8GB of RAM. This VM is >> dedicated to PostgreSQL. The main OS parameters I have tuned are: >> >> work_mem =3D 200MB > > That's a really big work_mem. I have mainline db servers with 128G of > ram that have work_mem set to 16M and that is still considered a > little high in my book. If you drop work_mem down to 1MB does the out > of memory go away? work_mem is how much memory EACH sort can use on > its own, if you have a plpgsql procedure that keeps running query > after query, it could use a LOT of memory really fast. > _________________________________________________________________________= _____________________________ > > This message contains information, which is confidential and may be subje= ct > to legal privilege. > If you are not the intended recipient, you must not peruse, use, > disseminate, distribute or copy this message. > If you have received this message in error, please notify us immediately > (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original messag= e. > LINZ accepts no responsibility for changes to this email, or for any > attachments, after its transmission from LINZ. > > Thank you. > _________________________________________________________________________= _____________________________ > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > --=20 ------------ pasman From JPalmer@linz.govt.nz Tue Mar 29 03:59:09 2011 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A1F031337BDD for ; Tue, 29 Mar 2011 00:59:09 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 26666-05 for ; Tue, 29 Mar 2011 03:58:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.linz.govt.nz (smtp.linz.govt.nz [210.54.54.160]) by mail.postgresql.org (Postfix) with ESMTP id 7D43B1337B47 for ; Tue, 29 Mar 2011 00:58:49 -0300 (ADT) Received: from prdlsmmsg01.ad.linz.govt.nz (Not Verified[127.0.0.1]) by smtp.linz.govt.nz with our Gateway Software id ; Tue, 29 Mar 2011 16:58:47 +1300 Received: from prdlsmmsg01.ad.linz.govt.nz ([127.0.0.1]) by prdlsmmsg01.ad.linz.govt.nz ([127.0.0.1]) with mapi; Tue, 29 Mar 2011 16:58:47 +1300 From: Jeremy Palmer To: Jeremy Palmer CC: "pgsql-general@postgresql.org" , Scott Marlowe Date: Tue, 29 Mar 2011 16:58:48 +1300 Subject: Re: Out of memory Thread-Topic: [GENERAL] Out of memory Thread-Index: AcvqocALf9T7ZkI7SDSlpz9d5/r0pgA7/eRcAIy835A= Message-ID: <666FB8D75E95AE42965A0E76A5E5337E06DC8E10A4@prdlsmmsg01.ad.linz.govt.nz> References: <666FB8D75E95AE42965A0E76A5E5337E06DBA892F6@prdlsmmsg01.ad.linz.govt.nz>, <666FB8D75E95AE42965A0E76A5E5337E06DBA6B78C@prdlsmmsg01.ad.linz.govt.nz> In-Reply-To: <666FB8D75E95AE42965A0E76A5E5337E06DBA6B78C@prdlsmmsg01.ad.linz.govt.nz> Accept-Language: en-US, en-NZ X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-NZ MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/974 X-Sequence-Number: 174235 I'm wondering if there is a way to estimate the total amount of work memo= ry that will be used for a single query (or more specifically a plpgsql f= unction that runs a series of queries)=20 The database that I'm setting up is a data warehouse which typically only= =20has one query running at any given time. Thanks, Jeremy -----Original Message----- From: Jeremy Palmer=20 Sent: Saturday, 26 March 2011 9:57 p.m. To: Scott Marlowe Cc: pgsql-general@postgresql.org Subject: RE: [GENERAL] Out of memory Hi Scott, It was the work_mem that was set too high. I reduced it to 32mb and the f= unction executed. Just so I understand this. Every time a sort is performed within a functi= on, the sort memory is allocated, and then it not released until the func= tion completes? Rather then deallocating the memory after each sort opera= tion has completed. Thanks, Jeremy=20 ________________________________________ From: Scott Marlowe [scott.marlowe@gmail.com] Sent: Friday, 25 March 2011 5:04 p.m. To: Jeremy Palmer Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Out of memory On Thu, Mar 24, 2011 at 9:23 PM, Jeremy Palmer wro= te: > I've been getting database out of memory failures with some queries whi= ch > deal with a reasonable amount of data. > > I was wondering what I should be looking at to stop this from happening= . > > The typical messages I been getting are like this: > http://pastebin.com/Jxfu3nYm > The OS is: > > Linux TSTLHAPP01 2.6.32-29-server #58-Ubuntu SMP Fri Feb 11 21:06:51 UT= C > 2011 x86_64 GNU/Linux. > > It's a running on VMWare and, has 2 CPU's and 8GB of RAM. This VM is > dedicated to PostgreSQL. The main OS parameters I have tuned are: > > work_mem =3D 200MB That's a really big work_mem. I have mainline db servers with 128G of ram that have work_mem set to 16M and that is still considered a little high in my book. If you drop work_mem down to 1MB does the out of memory go away? work_mem is how much memory EACH sort can use on its own, if you have a plpgsql procedure that keeps running query after query, it could use a LOT of memory really fast. _________________________________________________________________________= _____________________________ This message contains information, which is confidential and may be subje= ct to legal privilege.=20 If you are not the intended recipient, you must not peruse, use, dissemin= ate, distribute or copy this message. If you have received this message in error, please notify us immediately = (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original messag= e. LINZ accepts no responsibility for changes to this email, or for any atta= chments, after its transmission from LINZ. Thank you. _________________________________________________________________________= _____________________________ From JPalmer@linz.govt.nz Tue Apr 5 09:51:08 2011 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2E23113364DE for ; Tue, 5 Apr 2011 06:51:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 55353-05 for ; Tue, 5 Apr 2011 09:50:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.linz.govt.nz (smtp.linz.govt.nz [210.54.54.160]) by mail.postgresql.org (Postfix) with ESMTP id 1C4E7133616B for ; Tue, 5 Apr 2011 06:50:46 -0300 (ADT) Received: from prdlsmmsg01.ad.linz.govt.nz (Not Verified[127.0.0.1]) by smtp.linz.govt.nz with our Gateway Software id ; Tue, 05 Apr 2011 21:50:44 +1200 Received: from prdlsmmsg01.ad.linz.govt.nz ([127.0.0.1]) by prdlsmmsg01.ad.linz.govt.nz ([127.0.0.1]) with mapi; Tue, 5 Apr 2011 21:50:45 +1200 From: Jeremy Palmer To: "pgsql-general@postgresql.org" Date: Tue, 5 Apr 2011 21:50:44 +1200 Subject: Out of memory Thread-Topic: Out of memory Thread-Index: AQHL8rBE/QVPtCDul0+Kd8FcAeZjPA== Message-ID: <666FB8D75E95AE42965A0E76A5E5337E06DCC19F63@prdlsmmsg01.ad.linz.govt.nz> Accept-Language: en-US, en-NZ X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-NZ MIME-Version: 1.0 Content-Language: en-NZ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/125 X-Sequence-Number: 174481 Hi, I've been having repeated troubles trying to get a PostgreSQL app to play= =20nicely on Ubuntu. I recently posted a message on this list about an ou= t of memory error and got a resolution by reducing the work_mem setting. = However I'm now getting further out of memory issues during the same stag= e of plpgsql function as mentioned before. The function itself is run as part of larger transaction which does the f= ollowing: 1/ Maintains 104 tables (15 PostGIS tables), by loading and applying incr= emental table changes. A typical incremental load with maintain about 10,= 000 rows. 2/ When each one of these tables is updated an after trigger is fired tha= t maintains an associated table revision table. 3/ After all of the tables are maintained a plpgsql function is called to= =20build/maintain a set of de-normalised tables. These tables total about= =2020GB. Each one of these tables is compared against the previous table = revision to determine its row changes. It's in this function that the out= =20of memory exception is occurring. The server log error message I'm getting in the function is here http://p= astebin.com/346zi2sS. It's very long and contains the top transaction mem= ory debug info. My initial observation about this error is that maybe PostgreSQL is encou= ntering a memory corruption error because the amount of OS memory does no= t seem to run out. The plpgsql function uses functions from both PostGIS = and pgc_checksum (http://pgfoundry.org/projects/pg-comparator) - so maybe= =20they are the cause of the problem. Or maybe I have configured somethin= g wrong... I did some memory logging during and the execution of the function. It sh= ows for the majority of the transaction execution that the actual memory = used is about 1GB (grows from the initial 600mb) with about 6.5GB cached = for the OS: =20 total used free shared buffers cach= ed Mem: 8004 7839 165 0 0 6802= -/+ buffers/cache: 1037 6967 Swap: 397 0 397 But just before the out of memory error occurs there is a spike to 2.5GB = of used memory, but there us still 4.5GB cached by the OS: =20 total used free shared buffers cach= ed Mem: 8004 7702 301 0 0 4854= -/+ buffers/cache: 2848 5156 Swap: 397 0 397 Then after the error the memory slowly returns this state: =20 total used free shared buffers cach= ed Mem: 8004 1478 6526 0 0 1133= -/+ buffers/cache: 345 7659 Swap: 397 0 397 The OS I'm running is: =20 Linux TSTLHAPP01 2.6.32-29-server #58-Ubuntu SMP Fri Feb 11 21:06:51 UTC = 2011 x86_64 GNU/Linux. =20 It=92s a running on VMWare and, has 2 CPU=92s and 8GB of RAM. This VM is = dedicated to PostgreSQL, not much else is running other than cacti, ssh a= nd ftp server daemons. The main OS parameters I have tuned are: =20 vm.swappiness=3D0 vm.overcommit_memory=3D2 kernel.shmmax =3D 4196769792 kernel.shmall =3D 1024602 =20 And the PostgreSQL is: =20 PostgreSQL 9.0.3 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ub= untu 4.4.3-4ubuntu5) 4.4.3, 64-bit. =20 The main changed postgresql.conf parameters I've tuned are: =20 shared_buffers =3D 512MB maintenance_work_mem =3D 512MB temp_buffers =3D 256MB work_mem =3D 1MB wal_buffers =3D 16MB effective_cache_size =3D 4094MB The size of the database is 350GB. The typical number of users connected = to the database is 1 or 2. This database is used for loading external dat= a, managing revision table information and generating and outputting de-n= ormalised datasets, so it does not have a high number of transactions run= ning. Typically 1 large one per day. Two questions: 1) Have I set the OS and postgresql parameter to sensible values given th= e hardware and database utilization. 2) Can anyone help me make sense of the top transaction memory error to h= elp track down the issue? Any other suggestions would be greatly appreciated. Thanks Jeremy ________________________________________ From: Jeremy Palmer Sent: Saturday, 26 March 2011 9:57 p.m. To: Scott Marlowe Cc: pgsql-general@postgresql.org Subject: RE: [GENERAL] Out of memory Hi Scott, It was the work_mem that was set too high. I reduced it to 32mb and the f= unction executed. Just so I understand this. Every time a sort is performed within a functi= on, the sort memory is allocated, and then it not released until the func= tion completes? Rather then deallocating the memory after each sort opera= tion has completed. Thanks, Jeremy ________________________________________ From: Scott Marlowe [scott.marlowe@gmail.com] Sent: Friday, 25 March 2011 5:04 p.m. To: Jeremy Palmer Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Out of memory On Thu, Mar 24, 2011 at 9:23 PM, Jeremy Palmer wro= te: > I=92ve been getting database out of memory failures with some queries w= hich > deal with a reasonable amount of data. > > I was wondering what I should be looking at to stop this from happening= . > > The typical messages I been getting are like this: > http://pastebin.com/Jxfu3nYm > The OS is: > > Linux TSTLHAPP01 2.6.32-29-server #58-Ubuntu SMP Fri Feb 11 21:06:51 UT= C > 2011 x86_64 GNU/Linux. > > It=92s a running on VMWare and, has 2 CPU=92s and 8GB of RAM. This VM i= s > dedicated to PostgreSQL. The main OS parameters I have tuned are: > > work_mem =3D 200MB That's a really big work_mem. I have mainline db servers with 128G of ram that have work_mem set to 16M and that is still considered a little high in my book. If you drop work_mem down to 1MB does the out of memory go away? work_mem is how much memory EACH sort can use on its own, if you have a plpgsql procedure that keeps running query after query, it could use a LOT of memory really fast. _________________________________________________________________________= _____________________________ This message contains information, which is confidential and may be subje= ct to legal privilege.=20 If you are not the intended recipient, you must not peruse, use, dissemin= ate, distribute or copy this message. If you have received this message in error, please notify us immediately = (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original messag= e. LINZ accepts no responsibility for changes to this email, or for any atta= chments, after its transmission from LINZ. Thank you. _________________________________________________________________________= _____________________________ From pgsql@j-davis.com Tue Apr 5 19:07:12 2011 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8AF1E133740B for ; Tue, 5 Apr 2011 16:07:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 31883-08 for ; Tue, 5 Apr 2011 19:06:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f174.google.com (mail-gx0-f174.google.com [209.85.161.174]) by mail.postgresql.org (Postfix) with ESMTP id 6C6CF1337BCF for ; Tue, 5 Apr 2011 16:06:54 -0300 (ADT) Received: by gxk21 with SMTP id 21so281422gxk.19 for ; Tue, 05 Apr 2011 12:06:53 -0700 (PDT) Received: by 10.236.138.231 with SMTP id a67mr23024yhj.216.1302030413665; Tue, 05 Apr 2011 12:06:53 -0700 (PDT) Received: from [10.10.3.129] (71-6-94-66.static-ip.telepacific.net [71.6.94.66]) by mx.google.com with ESMTPS id x74sm2981434yhn.54.2011.04.05.12.06.51 (version=SSLv3 cipher=OTHER); Tue, 05 Apr 2011 12:06:51 -0700 (PDT) Subject: Re: Out of memory From: Jeff Davis To: Jeremy Palmer Cc: "pgsql-general@postgresql.org" In-Reply-To: <666FB8D75E95AE42965A0E76A5E5337E06DCC19F63@prdlsmmsg01.ad.linz.govt.nz> References: <666FB8D75E95AE42965A0E76A5E5337E06DCC19F63@prdlsmmsg01.ad.linz.govt.nz> Content-Type: text/plain; charset="ISO-8859-1" Date: Tue, 05 Apr 2011 12:06:50 -0700 Message-ID: <1302030410.438.35.camel@jdavis-ux.asterdata.local> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/151 X-Sequence-Number: 174507 On Tue, 2011-04-05 at 21:50 +1200, Jeremy Palmer wrote: > Hi, > > I've been having repeated troubles trying to get a PostgreSQL app to play nicely on Ubuntu. I recently posted a message on this list about an out of memory error and got a resolution by reducing the work_mem setting. However I'm now getting further out of memory issues during the same stage of plpgsql function as mentioned before. > > The function itself is run as part of larger transaction which does the following: Where is the source to the function? Regards, Jeff Davis From pierce@hogranch.com Tue Apr 5 19:27:45 2011 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 3FA48133740B for ; Tue, 5 Apr 2011 16:27:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 79458-02 for ; Tue, 5 Apr 2011 19:27:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hogranch.com (hogranch.com [75.101.82.47]) by mail.postgresql.org (Postfix) with ESMTP id 668E013364DE for ; Tue, 5 Apr 2011 16:27:34 -0300 (ADT) Received: from [127.0.0.1] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id p35JRRc11451 for ; Tue, 5 Apr 2011 12:27:27 -0700 Message-ID: <4D9B6D1F.9050406@hogranch.com> Date: Tue, 05 Apr 2011 12:27:27 -0700 From: John R Pierce User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: Out of memory References: <666FB8D75E95AE42965A0E76A5E5337E06DCC19F63@prdlsmmsg01.ad.linz.govt.nz> In-Reply-To: <666FB8D75E95AE42965A0E76A5E5337E06DCC19F63@prdlsmmsg01.ad.linz.govt.nz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/154 X-Sequence-Number: 174510 On 04/05/11 2:50 AM, Jeremy Palmer wrote: > I've been having repeated troubles trying to get a PostgreSQL app to play nicely on Ubuntu. I recently posted a message on this list about an out of memory error and got a resolution by reducing the work_mem setting. However I'm now getting further out of memory issues during the same stage of plpgsql function as mentioned before. > > The function itself is run as part of larger transaction which does the following: > > 1/ Maintains 104 tables (15 PostGIS tables), by loading and applying incremental table changes. A typical incremental load with maintain about 10,000 rows. > > 2/ When each one of these tables is updated an after trigger is fired that maintains an associated table revision table. > > 3/ After all of the tables are maintained a plpgsql function is called to build/maintain a set of de-normalised tables. These tables total about 20GB. Each one of these tables is compared against the previous table revision to determine its row changes. It's in this function that the out of memory exception is occurring. a few random questions... Does that all really have to be a single transaction? Do you really need to use triggers for your revision tracking, and can't rely on your daily update cycle to manually set the revision information? Is it really necessary to generate massive denormalized tables, rather than using view's to join the data? > shared_buffers = 512MB > maintenance_work_mem = 512MB > temp_buffers = 256MB > work_mem = 1MB > wal_buffers = 16MB > effective_cache_size = 4094MB > > The size of the database is 350GB. The typical number of users connected to the database is 1 or 2. This database is used for loading external data, managing revision table information and generating and outputting de-normalised datasets, so it does not have a high number of transactions running. Typically 1 large one per day. with only 1-2 connections, you certainly could increase the work_mem. Alternately, this single giant transaction could manually set a larger work_mem which would only apply to it. Personally, given your 8gb system and what you've described, I think I'd set the tuning parameters something like... shared_buffers = 1GB maintenance_work_mem = 128MB temp_buffers = 64MB work_mem = 16MB wal_buffers = 16MB effective_cache_size = 4094MB adjust effective_cache_size to somewhat less than the 'cached' value shown in `free -m` after your system has been running for awhile. From JPalmer@linz.govt.nz Tue Apr 5 22:44:34 2011 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 577041337BF8 for ; Tue, 5 Apr 2011 19:44:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 28301-06-4 for ; Tue, 5 Apr 2011 22:44:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.linz.govt.nz (smtp.linz.govt.nz [210.54.54.160]) by mail.postgresql.org (Postfix) with ESMTP id 2B50F1337B4E for ; Tue, 5 Apr 2011 19:44:22 -0300 (ADT) Received: from prdlsmmsg01.ad.linz.govt.nz (Not Verified[127.0.0.1]) by smtp.linz.govt.nz with our Gateway Software id ; Wed, 06 Apr 2011 10:44:20 +1200 Received: from prdlsmmsg03.ad.linz.govt.nz (127.0.0.1) by prdlsmmsg01.ad.linz.govt.nz (127.0.0.1) with Microsoft SMTP Server (TLS) id 127.0.0.1; Wed, 6 Apr 2011 10:44:20 +1200 Received: from prdlsmmsg01.ad.linz.govt.nz ([127.0.0.1]) by prdlsmmsg03.ad.linz.govt.nz ([127.0.0.1]) with mapi; Wed, 6 Apr 2011 10:44:20 +1200 From: Jeremy Palmer To: "pierce@hogranch.com" , "pgsql-general@postgresql.org" Date: Wed, 6 Apr 2011 10:44:19 +1200 Subject: Re: Out of memory Thread-Topic: Re: Out of memory Thread-Index: Acvz4v/WpS3gBxa8QBuClD7ucKFXZw== Message-ID: <666FB8D75E95AE42965A0E76A5E5337E06DCE2C5FF@prdlsmmsg01.ad.linz.govt.nz> Accept-Language: en-US, en-NZ X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-NZ MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/158 X-Sequence-Number: 174514 Hi John, > Does that all really have to be a single transaction? Yes - I need to ensure that of the changesets and denormalised tables are= =20created in the same transaction, so that if an error occurs the databa= se is rolled back to the last successfully applied changeset. I don't wan= t to get into the business of the splitting it into separate transactions= =20and then having to revert changes that were applied in a previous tran= saction step. > Do you really need to use triggers for your revision tracking, and can'= t=20 > rely on your daily update cycle to manually set the revision informatio= n? They are not necessary, but it has the cleanest code implementation and m= akes the revision maintenance to the tables almost transparent. If they a= re causing the problem I could change the logic... > Is it really necessary to generate massive denormalized tables, rather = > than using view's to join the data? Yes - to create the tables is complex, and often involves complex functio= ns and multiple temp tables. The overall time to create these tables is s= omewhere in the area of 3hours on this server. I'm also unloading these t= ables multiple times for separate purposes, so they would need to be mate= rialised anyway. > with only 1-2 connections, you certainly could increase the work_mem.=20 I can't increase this value at the moment on this server because I was ge= tting out of memory errors with the initial population of the database (w= hich builds the denormalized tables, but does not determine the changeset= =20to the previous table revision).=20 I tried values, 256mb - 2mb and could only get the query to run with 1mb.= =20I suspect even this was pushing the boundary, so when I got to the nex= t stage in my testing - to apply incremental updates - the memory issue r= aised it head again. Regards, Jeremy _________________________________________________________________________= _____________________________ This message contains information, which is confidential and may be subje= ct to legal privilege.=20 If you are not the intended recipient, you must not peruse, use, dissemin= ate, distribute or copy this message. If you have received this message in error, please notify us immediately = (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original messag= e. LINZ accepts no responsibility for changes to this email, or for any atta= chments, after its transmission from LINZ. Thank you. _________________________________________________________________________= _____________________________ From JPalmer@linz.govt.nz Wed Apr 6 05:37:03 2011 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id C01C913364DE for ; Wed, 6 Apr 2011 02:37:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 43624-09 for ; Wed, 6 Apr 2011 05:36:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.linz.govt.nz (smtp.linz.govt.nz [210.54.54.160]) by mail.postgresql.org (Postfix) with ESMTP id 77FD71337B47 for ; Wed, 6 Apr 2011 02:36:51 -0300 (ADT) Received: from prdlsmmsg01.ad.linz.govt.nz (Not Verified[127.0.0.1]) by smtp.linz.govt.nz with our Gateway Software id ; Wed, 06 Apr 2011 17:36:49 +1200 Received: from prdlsmmsg03.ad.linz.govt.nz (127.0.0.1) by prdlsmmsg01.ad.linz.govt.nz (127.0.0.1) with Microsoft SMTP Server (TLS) id 127.0.0.1; Wed, 6 Apr 2011 17:36:50 +1200 Received: from prdlsmmsg01.ad.linz.govt.nz ([127.0.0.1]) by prdlsmmsg03.ad.linz.govt.nz ([127.0.0.1]) with mapi; Wed, 6 Apr 2011 17:36:49 +1200 From: Jeremy Palmer To: "pgsql@j-davis.com" , "pgsql-general@postgresql.org" Date: Wed, 6 Apr 2011 17:36:48 +1200 Subject: Re: Out of memory Thread-Topic: Re: Out of memory Thread-Index: Acv0HJ+uhb1GTsxpTryun4GkpXjasA== Message-ID: <666FB8D75E95AE42965A0E76A5E5337E06DCE2CBEE@prdlsmmsg01.ad.linz.govt.nz> Accept-Language: en-US, en-NZ X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-NZ MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/168 X-Sequence-Number: 174524 Hi Jeff, < Where is the source to the function?=A0 The source is located here: https://github.com/linz/linz_bde_uploader The main function LDS_MaintainSimplifiedLayers that is being called is on= =20line 37 is in https://github.com/linz/linz_bde_uploader/blob/master/sq= l/lds_layer_functions.sql.=20 The actual out of memory exception was caught with the bde_GetTableDiffer= ences function source file on line 3263 in https://github.com/linz/linz_b= de_uploader/blob/master/sql/bde_control_functions.sql. When I was actually getting an out of memory issue when creating the tabl= es (not maintaining them), the query that seemed to kill the transaction = was the one located at line 1463 of https://github.com/linz/linz_bde_uplo= ader/blob/master/sql/lds_layer_functions.sql. After I dropped the work_me= m to 1MB it got past that and completed ok. But during the maintenance of= =20the table the row differences need to be calculated and then applied t= o the table. See the LDS_ApplyTableDifferences function on line 353. Regards, Jeremy _________________________________________________________________________= _____________________________ This message contains information, which is confidential and may be subje= ct to legal privilege.=20 If you are not the intended recipient, you must not peruse, use, dissemin= ate, distribute or copy this message. If you have received this message in error, please notify us immediately = (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original messag= e. LINZ accepts no responsibility for changes to this email, or for any atta= chments, after its transmission from LINZ. Thank you. _________________________________________________________________________= _____________________________ From JPalmer@linz.govt.nz Tue Apr 12 10:12:23 2011 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 366A11337B8B for ; Tue, 12 Apr 2011 07:12:23 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 71723-08 for ; Tue, 12 Apr 2011 10:11:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.linz.govt.nz (smtp.linz.govt.nz [210.54.54.160]) by mail.postgresql.org (Postfix) with ESMTP id 9BB6A1337B47 for ; Tue, 12 Apr 2011 07:11:58 -0300 (ADT) Received: from prdlsmmsg01.ad.linz.govt.nz (Not Verified[127.0.0.1]) by smtp.linz.govt.nz with our Gateway Software id ; Tue, 12 Apr 2011 22:11:54 +1200 Received: from prdlsmmsg03.ad.linz.govt.nz (127.0.0.1) by prdlsmmsg01.ad.linz.govt.nz (127.0.0.1) with Microsoft SMTP Server (TLS) id 127.0.0.1; Tue, 12 Apr 2011 22:11:55 +1200 Received: from prdlsmmsg01.ad.linz.govt.nz ([127.0.0.1]) by prdlsmmsg03.ad.linz.govt.nz ([127.0.0.1]) with mapi; Tue, 12 Apr 2011 22:11:55 +1200 From: Jeremy Palmer To: "pgsql-general@postgresql.org" Date: Tue, 12 Apr 2011 22:11:54 +1200 Subject: Re: Out of memory Thread-Topic: Out of memory Thread-Index: AQHL8rBE/QVPtCDul0+Kd8FcAeZjPJRaC/aw Message-ID: <666FB8D75E95AE42965A0E76A5E5337E06DCC19F68@prdlsmmsg01.ad.linz.govt.nz> References: <666FB8D75E95AE42965A0E76A5E5337E06DCC19F63@prdlsmmsg01.ad.linz.govt.nz> In-Reply-To: <666FB8D75E95AE42965A0E76A5E5337E06DCC19F63@prdlsmmsg01.ad.linz.govt.nz> Accept-Language: en-US, en-NZ X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-NZ MIME-Version: 1.0 Content-Language: en-NZ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/390 X-Sequence-Number: 174746 Well after a few days of further investigation I still can't track the is= sue down. The main problem I can only reproduce the error running the who= le transaction. So I can't isolate the problem down to a simple use case = or even smaller subset of the transaction, which would have been nice for= =20posting to this list. Does anyone have an idea of how I might go about trying to tackle this pr= oblem now. Should I try further reducing the memory settings? Or install = a debug version of PostgreSQL and get some further information about what= =20is going on before the error. Any advice would be greatly appreciated.= Regards, Jeremy=20 ________________________________________ From: Jeremy Palmer Sent: Tuesday, 5 April 2011 9:50 p.m. To: pgsql-general@postgresql.org Subject: Out of memory Hi, I've been having repeated troubles trying to get a PostgreSQL app to play= =20nicely on Ubuntu. I recently posted a message on this list about an ou= t of memory error and got a resolution by reducing the work_mem setting. = However I'm now getting further out of memory issues during the same stag= e of plpgsql function as mentioned before. The function itself is run as part of larger transaction which does the f= ollowing: 1/ Maintains 104 tables (15 PostGIS tables), by loading and applying incr= emental table changes. A typical incremental load with maintain about 10,= 000 rows. 2/ When each one of these tables is updated an after trigger is fired tha= t maintains an associated table revision table. 3/ After all of the tables are maintained a plpgsql function is called to= =20build/maintain a set of de-normalised tables. These tables total about= =2020GB. Each one of these tables is compared against the previous table = revision to determine its row changes. It's in this function that the out= =20of memory exception is occurring. The server log error message I'm getting in the function is here http://p= astebin.com/346zi2sS. It's very long and contains the top transaction mem= ory debug info. My initial observation about this error is that maybe PostgreSQL is encou= ntering a memory corruption error because the amount of OS memory does no= t seem to run out. The plpgsql function uses functions from both PostGIS = and pgc_checksum (http://pgfoundry.org/projects/pg-comparator) - so maybe= =20they are the cause of the problem. Or maybe I have configured somethin= g wrong... I did some memory logging during and the execution of the function. It sh= ows for the majority of the transaction execution that the actual memory = used is about 1GB (grows from the initial 600mb) with about 6.5GB cached = for the OS: =20 total used free shared buffers cach= ed Mem: 8004 7839 165 0 0 6802= -/+ buffers/cache: 1037 6967 Swap: 397 0 397 But just before the out of memory error occurs there is a spike to 2.5GB = of used memory, but there us still 4.5GB cached by the OS: =20 total used free shared buffers cach= ed Mem: 8004 7702 301 0 0 4854= -/+ buffers/cache: 2848 5156 Swap: 397 0 397 Then after the error the memory slowly returns this state: =20 total used free shared buffers cach= ed Mem: 8004 1478 6526 0 0 1133= -/+ buffers/cache: 345 7659 Swap: 397 0 397 The OS I'm running is: Linux TSTLHAPP01 2.6.32-29-server #58-Ubuntu SMP Fri Feb 11 21:06:51 UTC = 2011 x86_64 GNU/Linux. It=92s a running on VMWare and, has 2 CPU=92s and 8GB of RAM. This VM is = dedicated to PostgreSQL, not much else is running other than cacti, ssh a= nd ftp server daemons. The main OS parameters I have tuned are: vm.swappiness=3D0 vm.overcommit_memory=3D2 kernel.shmmax =3D 4196769792 kernel.shmall =3D 1024602 And the PostgreSQL is: PostgreSQL 9.0.3 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ub= untu 4.4.3-4ubuntu5) 4.4.3, 64-bit. The main changed postgresql.conf parameters I've tuned are: shared_buffers =3D 512MB maintenance_work_mem =3D 512MB temp_buffers =3D 256MB work_mem =3D 1MB wal_buffers =3D 16MB effective_cache_size =3D 4094MB The size of the database is 350GB. The typical number of users connected = to the database is 1 or 2. This database is used for loading external dat= a, managing revision table information and generating and outputting de-n= ormalised datasets, so it does not have a high number of transactions run= ning. Typically 1 large one per day. Two questions: 1) Have I set the OS and postgresql parameter to sensible values given th= e hardware and database utilization. 2) Can anyone help me make sense of the top transaction memory error to h= elp track down the issue? Any other suggestions would be greatly appreciated. Thanks Jeremy _________________________________________________________________________= _____________________________ This message contains information, which is confidential and may be subje= ct to legal privilege.=20 If you are not the intended recipient, you must not peruse, use, dissemin= ate, distribute or copy this message. If you have received this message in error, please notify us immediately = (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original messag= e. LINZ accepts no responsibility for changes to this email, or for any atta= chments, after its transmission from LINZ. Thank you. _________________________________________________________________________= _____________________________ From enrico.bianchi@ymail.com Thu Jan 15 23:17:45 2015 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YBtfc-0002xH-Jq for pgsql-general@arkaria.postgresql.org; Thu, 15 Jan 2015 23:17:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YBtfb-0001C8-Va for pgsql-general@arkaria.postgresql.org; Thu, 15 Jan 2015 23:17:44 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YBtfa-0001C2-DW for pgsql-general@postgresql.org; Thu, 15 Jan 2015 23:17:42 +0000 Received: from nm25-vm6.bullet.mail.ir2.yahoo.com ([212.82.97.39]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YBtfM-0006js-Qy for pgsql-general@postgresql.org; Thu, 15 Jan 2015 23:17:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1421363846; bh=PbTOfdcoV76NvO3m5ESD2gAUj5ITyUZzKma7MQuYz+E=; h=Date:From:To:Subject:From:Subject; b=m2/TRT97H+JE2IHbVN8/0QrR3U0IslunJxX/XHIAfUX9LQZt48nSn3Sh/j3xKNeXlT531kIaolVjus4rGkq2S7W/DvBj+FuBCQfc2UonyOZcACgTJ2PEiCmMVCQf6vAIKycljlvJMdOfXnKIelpenHiOb73G56HumnAO/aA8YuvkYDldOXvM1MTBH5V82pKtuBgqbfojVHv4MfFK5dh2ICmcnOTv/yhDlxKHhf09TFbgoxJfpEgjiHwjIc+iOl6iEAdFyiZfnkaFW98QOrsNP2PKeow0RRVY0QYFUypby/fMabqzGfyVQInBoa0V5g0wZnClpZ2Meg18o+v1Tl+jGQ== Received: from [212.82.98.55] by nm25.bullet.mail.ir2.yahoo.com with NNFMP; 15 Jan 2015 23:17:26 -0000 Received: from [46.228.39.71] by tm8.bullet.mail.ir2.yahoo.com with NNFMP; 15 Jan 2015 23:17:26 -0000 Received: from [127.0.0.1] by smtp108.mail.ir2.yahoo.com with NNFMP; 15 Jan 2015 23:17:26 -0000 X-Yahoo-Newman-Id: 22108.72761.bm@smtp108.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: sGIRQ3oVM1nEPBQNZvmIPbLCK3YhkQ2rE1PS9ivLDcD6RLU aOO2je3U56KeLQKlJCuSorAGBk5L3KsrQnyzEDmywt9wbPbxjKqrWsTa8XDF XQrInVRFEWmgU1nZADdKJZTanOp3QUVwFVvhn_EZ5eeGK9QqXYpCxDMnrC0z VBKw0TtZIijRS.wn2z.BBRUqz8Qn26ozd1aD1XrxXRIsGxhMORIwVWgDVBTr bdYjhtJFLjNNsnCUt_unwJLX2OCplVKLmd1miaWGO.ri5G1t1.s0MLhNxBPu HPkUjQONUnUZUUcPUj9b.KEWYZEXaAUz4obckPZhV8L8QRlOglCq.zha3efN FdX2D5RDsGczpqMY1DgKHyfuQ3biouKt98G_q8Xz1lBzqHK2aYJVPaXt8Fvs yVa1X77A.gEmLq9_9M2SPAnLPuBiFoDi0plz8_WzpEheENEwQHpGqg8tOGNF kPEsoVYhcCxYPble3Y0T2M51Qtp3M8AMRbseMHjdpzMkhLHYJsDL0cVxdxRU fqi_nX8D1eAjVWzlgIPPnN38zML6AVVhhlef1uK4RCR8LsV_UJWMePrLi2Q- - X-Yahoo-SMTP: 3uDVuluswBBbOWxip8ozdb.._tg10pMkLWhFGuowizMhZ4W.SQ-- Message-ID: <54B84A83.9020003@ymail.com> Date: Fri, 16 Jan 2015 00:17:23 +0100 From: Enrico Bianchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Out of Memory Content-Type: multipart/alternative; boundary="------------010706010403020803030905" X-Pg-Spam-Score: -0.2 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org This is a multi-part message in MIME format. --------------010706010403020803030905 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I have this situation: Machine: VPS with CentOS 6.6 x86_64 64GB of RAM 2GB of swap (unused) Ulimit settings: postgres soft nproc 2047 postgres hard nproc 16384 postgres soft nofile 1024 postgres hard nofile 65536 postgres hard stack 10240 PostgreSQL 9.4.0 from official repositories. Postgresql.conf is: listen_addresses = '*' port = 5432 max_connections = 20 shared_buffers = 16GB effective_cache_size = 48GB work_mem = 419430kB maintenance_work_mem = 2GB checkpoint_segments = 128 checkpoint_completion_target = 0.9 wal_buffers = 16MB default_statistics_target = 500 When I launch a query (the principal field is JSONb), the database return this: ERROR: out of memory DETAIL: Failed on request of size 110558. This is the query: SELECT CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN field_id ->'comment'->>'id' WHEN '[' THEN jsonb_array_elements(field_id ->'comment')->>'id' ELSE NULL END AS comment_id, CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN field_id ->'comment'->'from'->>'id' WHEN '[' THEN jsonb_array_elements(field_id ->'comment')->'from'->>'id' ELSE NULL END AS user_id, field_id ->> '_id' post_id, CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN (field_id ->'comment'->>'created_timestamp')::timestamp without time zone WHEN '[' THEN (jsonb_array_elements(field_id ->'comment')->>'created_time')::timestamp without time zone ELSE NULL END AS comment_create_date, CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN cast(to_char((field_id ->'comment'->>'created_time')::timestamp without time zone,'YYYYMMDD') as numeric) WHEN '[' THEN cast(to_char((jsonb_array_elements(field_id ->'comment')->>'created_time')::timestamp without time zone,'YYYYMMDD') as numeric) ELSE NULL END AS comment_created_day, field_id ->> 'pageId' page_id, CASE substring(field_id->>'feedtype',1,1) WHEN 'f' THEN 2 WHEN 'b' THEN 1 ELSE 3 END AS owner_type, 'WALL' comment_type, CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN to_char((field_id ->'comment'->>'created_time')::timestamp without time zone,'HH24')::numeric WHEN '[' THEN to_char((jsonb_array_elements(field_id ->'comment')->>'created_time')::timestamp without time zone,'HH24')::numeric ELSE NULL END AS comment_time_slot, CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN (field_id ->'comment'->>'like_count')::numeric WHEN '[' THEN (jsonb_array_elements(field_id ->'comment')->>'like_count')::numeric ELSE NULL END AS like_count, 1 as sn_id, 17 AS group_id FROM stage.fbcomment WHERE field_id ->> 'pageId' in (SELECT stage.eng_page.identifier::text FROM stage.eng_group_page, stage.eng_page where stage.eng_group_page.page_id=stage.eng_page._id AND stage.eng_group_page.group_id=17 ) ; And this is the query plan: QUERY PLAN --------------------------------------------------------------------------------------------------- Nested Loop (cost=49.52..57597.31 rows=6729600 width=989) -> HashAggregate (cost=41.38..42.02 rows=64 width=12) Group Key: (eng_page.identifier)::text -> Hash Join (cost=32.54..41.22 rows=64 width=12) Hash Cond: (eng_group_page.page_id = eng_page._id) -> Bitmap Heap Scan on eng_group_page (cost=4.77..12.57 rows=64 width=5) Recheck Cond: (group_id = 17::numeric) -> Bitmap Index Scan on pk_eng_group_page (cost=0.00..4.76 rows=64 width=0) Index Cond: (group_id = 17::numeric) -> Hash (cost=17.34..17.34 rows=834 width=17) -> Seq Scan on eng_page (cost=0.00..17.34 rows=834 width=17) -> Bitmap Heap Scan on fbcomment (cost=8.14..103.95 rows=673 width=989) Recheck Cond: ((field_id ->> 'pageId'::text) = (eng_page.identifier)::text) -> Bitmap Index Scan on fbcomment_idx (cost=0.00..7.97 rows=673 width=0) Index Cond: ((field_id ->> 'pageId'::text) = (eng_page.identifier)::text) (15 rows) The query goes wrong also a subset of data extracted from the subquery. With this subset (5 values with generate 336500 records), vmstat is this: procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu----- r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 0 64467148 16888 996464 0 0 5 1 75 40 5 1 94 0 0 2 0 0 64365252 16888 996464 0 0 0 0 734 167 13 2 82 0 2 1 0 0 63471488 16888 996464 0 0 0 1 1102 176 21 4 75 0 0 1 0 0 62257732 16888 996464 0 0 0 12 1070 160 21 4 74 0 2 1 0 0 60939172 16888 996464 0 0 0 0 1072 158 21 4 75 0 0 1 0 0 59627188 16888 996464 0 0 0 6 1071 161 21 4 75 0 0 1 0 0 58324692 16888 996464 0 0 0 0 1069 152 21 4 75 0 0 1 0 0 57002732 16888 996464 0 0 0 0 1049 133 21 4 75 0 0 1 0 0 55671200 16888 996464 0 0 0 1 1076 152 21 4 75 0 0 1 0 0 54316064 16896 996460 0 0 0 4 1056 140 21 4 75 0 0 1 0 0 52939020 16896 996464 0 0 0 0 1052 140 22 3 75 0 0 1 0 0 51558644 16896 996464 0 0 0 5 1069 156 21 4 75 0 0 1 0 0 50188544 16896 996464 0 0 0 0 1069 156 21 4 75 0 0 0 0 0 64464804 16896 996476 0 0 0 0 557 269 6 7 88 0 0 Any hint for resolving the problem is appreciated Cheers, Enrico --------------010706010403020803030905 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit I have this situation:

Machine:
VPS with CentOS 6.6 x86_64
64GB of RAM
2GB of swap (unused)

Ulimit settings:
postgres            soft    nproc   2047                                                               
postgres            hard    nproc   16384                                                              
postgres            soft    nofile  1024                                                               
postgres            hard    nofile  65536                                                              
postgres            hard    stack   10240

PostgreSQL 9.4.0 from official repositories. Postgresql.conf is:

listen_addresses = '*'                                                                                 
port = 5432
max_connections = 20                                                                                   
shared_buffers = 16GB                                                                                  
effective_cache_size = 48GB                                                                            
work_mem = 419430kB                                                                                    
maintenance_work_mem = 2GB                                                                             
checkpoint_segments = 128                                                                              
checkpoint_completion_target = 0.9                                                                     
wal_buffers = 16MB                                                                                     
default_statistics_target = 500

When I launch a query (the principal field is JSONb), the database return this:

ERROR:  out of memory
DETAIL:  Failed on request of size 110558.

This is the query:

SELECT CASE substring((field_id ->'comment')::text,1,1)
          WHEN '{' THEN field_id ->'comment'->>'id'
          WHEN '[' THEN jsonb_array_elements(field_id ->'comment')->>'id'
          ELSE NULL
        END AS comment_id,
        CASE substring((field_id ->'comment')::text,1,1)
          WHEN '{' THEN field_id ->'comment'->'from'->>'id'
          WHEN '[' THEN jsonb_array_elements(field_id ->'comment')->'from'->>'id'
          ELSE NULL
        END AS user_id,
        field_id ->> '_id' post_id,
        CASE substring((field_id ->'comment')::text,1,1)
          WHEN '{' THEN (field_id ->'comment'->>'created_timestamp')::timestamp without time zone
          WHEN '[' THEN (jsonb_array_elements(field_id ->'comment')->>'created_time')::timestamp without time zone
          ELSE NULL
        END AS comment_create_date,
        CASE substring((field_id ->'comment')::text,1,1)
          WHEN '{' THEN cast(to_char((field_id ->'comment'->>'created_time')::timestamp without time zone,'YYYYMMDD') as numeric)
          WHEN '[' THEN  cast(to_char((jsonb_array_elements(field_id ->'comment')->>'created_time')::timestamp without time zone,'YYYYMMDD') as numeric)
          ELSE NULL
        END AS comment_created_day,
        field_id ->> 'pageId' page_id,
        CASE substring(field_id->>'feedtype',1,1)
          WHEN 'f' THEN 2
          WHEN 'b' THEN 1
          ELSE 3
        END AS owner_type,
        'WALL' comment_type,
       CASE substring((field_id ->'comment')::text,1,1)
          WHEN '{' THEN to_char((field_id ->'comment'->>'created_time')::timestamp without time zone,'HH24')::numeric
          WHEN '[' THEN  to_char((jsonb_array_elements(field_id ->'comment')->>'created_time')::timestamp without time zone,'HH24')::numeric
          ELSE NULL
        END AS comment_time_slot,
        CASE substring((field_id ->'comment')::text,1,1)
          WHEN '{' THEN (field_id ->'comment'->>'like_count')::numeric
          WHEN '[' THEN (jsonb_array_elements(field_id ->'comment')->>'like_count')::numeric
          ELSE NULL
        END AS like_count,
        1 as sn_id,
        17 AS group_id
 FROM stage.fbcomment
 WHERE field_id ->> 'pageId' in (SELECT stage.eng_page.identifier::text
                                    FROM  stage.eng_group_page,
                                         stage.eng_page
                                   where stage.eng_group_page.page_id=stage.eng_page._id
                                     AND stage.eng_group_page.group_id=17
                                 )
;

And this is the query plan:

                                            QUERY PLAN
---------------------------------------------------------------------------------------------------
 Nested Loop  (cost=49.52..57597.31 rows=6729600 width=989)
   ->  HashAggregate  (cost=41.38..42.02 rows=64 width=12)
         Group Key: (eng_page.identifier)::text
         ->  Hash Join  (cost=32.54..41.22 rows=64 width=12)
               Hash Cond: (eng_group_page.page_id = eng_page._id)
               ->  Bitmap Heap Scan on eng_group_page (cost=4.77..12.57 rows=64 width=5)
                     Recheck Cond: (group_id = 17::numeric)
                     ->  Bitmap Index Scan on pk_eng_group_page (cost=0.00..4.76 rows=64 width=0)
                           Index Cond: (group_id = 17::numeric)
               ->  Hash  (cost=17.34..17.34 rows=834 width=17)
                     ->  Seq Scan on eng_page  (cost=0.00..17.34 rows=834 width=17)
   ->  Bitmap Heap Scan on fbcomment  (cost=8.14..103.95 rows=673 width=989)
         Recheck Cond: ((field_id ->> 'pageId'::text) = (eng_page.identifier)::text)
         ->  Bitmap Index Scan on fbcomment_idx  (cost=0.00..7.97 rows=673 width=0)
               Index Cond: ((field_id ->> 'pageId'::text) = (eng_page.identifier)::text)
(15 rows)

The query goes wrong also a subset of data extracted from the subquery. With this subset (5 values with generate 336500 records), vmstat is this:

procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 64467148  16888 996464    0    0     5     1   75   40 5  1 94  0  0
 2  0      0 64365252  16888 996464    0    0     0     0  734  167 13  2 82  0  2
 1  0      0 63471488  16888 996464    0    0     0     1 1102  176 21  4 75  0  0
 1  0      0 62257732  16888 996464    0    0     0    12 1070  160 21  4 74  0  2
 1  0      0 60939172  16888 996464    0    0     0     0 1072  158 21  4 75  0  0
 1  0      0 59627188  16888 996464    0    0     0     6 1071  161 21  4 75  0  0
 1  0      0 58324692  16888 996464    0    0     0     0 1069  152 21  4 75  0  0
 1  0      0 57002732  16888 996464    0    0     0     0 1049  133 21  4 75  0  0
 1  0      0 55671200  16888 996464    0    0     0     1 1076  152 21  4 75  0  0
 1  0      0 54316064  16896 996460    0    0     0     4 1056  140 21  4 75  0  0
 1  0      0 52939020  16896 996464    0    0     0     0 1052  140 22  3 75  0  0
 1  0      0 51558644  16896 996464    0    0     0     5 1069  156 21  4 75  0  0
 1  0      0 50188544  16896 996464    0    0     0     0 1069  156 21  4 75  0  0
 0  0      0 64464804  16896 996476    0    0     0     0  557  269 6  7 88  0  0

Any hint for resolving the problem is appreciated

Cheers,
Enrico
--------------010706010403020803030905-- From pierce@hogranch.com Fri Jan 16 00:20:13 2015 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YBue5-00056z-7S for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 00:20:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YBue4-0000RI-Mx for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 00:20:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YBue3-0000OQ-4M for pgsql-general@postgresql.org; Fri, 16 Jan 2015 00:20:11 +0000 Received: from hogranch.com ([75.101.82.47]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YBudz-0007kR-8o for pgsql-general@postgresql.org; Fri, 16 Jan 2015 00:20:10 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id t0G0JvH23597 for ; Thu, 15 Jan 2015 16:19:58 -0800 Message-ID: <54B85928.6030401@hogranch.com> Date: Thu, 15 Jan 2015 16:19:52 -0800 From: John R Pierce User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: Out of Memory References: <54B84A83.9020003@ymail.com> In-Reply-To: <54B84A83.9020003@ymail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 1/15/2015 3:17 PM, Enrico Bianchi wrote: > When I launch a query (the principal field is JSONb), the database > return this: > > ERROR: out of memory > DETAIL: Failed on request of size 110558. it looks like your query is trying to return 7 million rows, although you didn't do EXPLAIN ANALYZE, so your query plan statistics are all estimates. without knowing your schema and table contents its hard to say more. -- john r pierce 37N 122W somewhere on the middle of the left coast -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general From tgl@sss.pgh.pa.us Fri Jan 16 01:18:57 2015 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YBvYv-0006yX-6Q for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 01:18:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YBvYu-0008Um-Ky for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 01:18:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YBvYt-0008Rp-0H for pgsql-general@postgresql.org; Fri, 16 Jan 2015 01:18:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YBvYp-0000Zt-RT for pgsql-general@postgresql.org; Fri, 16 Jan 2015 01:18:53 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t0G1Inw6003682; Thu, 15 Jan 2015 20:18:49 -0500 From: Tom Lane To: Enrico Bianchi cc: pgsql-general@postgresql.org Subject: Re: Out of Memory In-reply-to: <54B84A83.9020003@ymail.com> References: <54B84A83.9020003@ymail.com> Comments: In-reply-to Enrico Bianchi message dated "Fri, 16 Jan 2015 00:17:23 +0100" Date: Thu, 15 Jan 2015 20:18:49 -0500 Message-ID: <3681.1421371129@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Enrico Bianchi writes: > When I launch a query (the principal field is JSONb), the database > return this: > ERROR: out of memory > DETAIL: Failed on request of size 110558. That error should be associated with a memory usage map getting dumped to postmaster stderr, where hopefully your logging setup will catch it. Can we see the map? Even better would be a self-contained test case. Maybe you can generate some artificial data that produces the problem? regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general From enrico.bianchi@ymail.com Fri Jan 16 08:58:39 2015 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YC2jn-0004W9-7D for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 08:58:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YC2jm-0007hZ-50 for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 08:58:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YC2jk-0007hT-ID for pgsql-general@postgresql.org; Fri, 16 Jan 2015 08:58:36 +0000 Received: from nm7.bullet.mail.ir2.yahoo.com ([212.82.96.69]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YC2je-0000X7-Cr for pgsql-general@postgresql.org; Fri, 16 Jan 2015 08:58:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1421398698; bh=anlxpvBmNtd8HoDv9zx259093GPssFos8B/6qOQ0WEs=; h=Date:From:To:Subject:References:In-Reply-To:From:Subject; b=eITD74gjwdv4MSbDSb3bBo1xIH6hdwTIfVLM/nfMztOlLXB4pKKNOUp6eU/TN0Q55PqQkOEBPX9BwUJg6SdETOD9EoG4uQeUn5VwOAPB3Dr9887Z7nvrmXeXjmeyB+mW1piIWW4hXsdfTxh9EyVSouTIy4e3vGhkDO72AW8rOmQhm26WhMZmuNHOBC/U8pEP0X7L7c9yaF4Lr4jlhEz+KPPiHqWJzrN7PzGyDFXT9vzrXxEASItdZgAyuSlzFWuo6JVGCKtdyExh0+kxzICcfvIgRITWpHhh26ZT9+4OaJChhBSddLuEJ0+yfINQr0+SsfLnAzUSW3InHNs11Y+rCQ== Received: from [212.82.98.63] by nm7.bullet.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 08:58:18 -0000 Received: from [46.228.39.93] by tm16.bullet.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 08:58:17 -0000 Received: from [127.0.0.1] by smtp130.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 08:58:17 -0000 X-Yahoo-Newman-Id: 794645.79719.bm@smtp130.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: JgtDtEsVM1ksENyrTkx2ZA3sLcpLFAs_XNTfdZNwBuwmgtt DhdPMpT63Gq3d6GLriO50gTZPIJVePJzgF5tA_qmK8yU7XRQh3oKXMKS8B13 NIfiencr4WZ3_MwxwYvvgU7apAq6x9lO9QT2cEst3YC0yUVUtCmggrWm1F5v nOWmkkHqshhwN_RWCAubifu.UDQYKRY_xm.3eZyqilqRPbLJlpxVPsB59IYb lO8Xf5yFuhqoknpAHcaNVK3On0f_CtIJ2odZd5HUbxr.mKaieTGxP5NtccRu 16nO3wDQi9UcrOpmsRHy8NxAfuh4Fwl4WEqfJOS6hl9dtOvH4JzRL.S9.EFe syl.CBkPEH4quF4gWAf5Yqgubb7i7Cov7AApzIGyluXQRN8TD544EDBi9gs1 nhLE1c90OAFnyYnbP1ZiJs6GvgA0wnsxUO6VbZfSsHAFqB6QbnWd_ClyT7jl T5rMlbvOtI_MvPI.uyf4uLcRKpIPUlS07JXtqSR1pKWlx4fFB24Ofr4exZfO ZxLqf0fp1qe6oMl3v3Dj6zCmU5IWny5adNSkT78_ZBehp5flIu1KYLItC X-Yahoo-SMTP: 3uDVuluswBBbOWxip8ozdb.._tg10pMkLWhFGuowizMhZ4W.SQ-- Message-ID: <54B8D2A8.4090904@ymail.com> Date: Fri, 16 Jan 2015 09:58:16 +0100 From: Enrico Bianchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: Out of Memory References: <54B84A83.9020003@ymail.com> <3681.1421371129@sss.pgh.pa.us> In-Reply-To: <3681.1421371129@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 01/16/2015 02:18 AM, Tom Lane wrote: > Can we see the map? This is the log when executing the query with a subset of data: < 2015-01-16 08:47:43.517 GMT >DEBUG: StartTransactionCommand < 2015-01-16 08:47:43.517 GMT >DEBUG: StartTransaction < 2015-01-16 08:47:43.517 GMT >DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:47:51.121 GMT >DEBUG: StartTransaction < 2015-01-16 08:47:51.121 GMT >DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:47:51.121 GMT >DEBUG: CommitTransaction < 2015-01-16 08:47:51.121 GMT >DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:47:51.121 GMT >DEBUG: received inquiry for database 0 < 2015-01-16 08:47:51.121 GMT >DEBUG: writing stats file "pg_stat_tmp/global.stat" < 2015-01-16 08:47:51.121 GMT >DEBUG: writing stats file "pg_stat_tmp/db_0.stat" < 2015-01-16 08:47:51.132 GMT >DEBUG: InitPostgres < 2015-01-16 08:47:51.133 GMT >DEBUG: my backend ID is 6 < 2015-01-16 08:47:51.133 GMT >DEBUG: StartTransaction < 2015-01-16 08:47:51.133 GMT >DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:47:51.134 GMT >DEBUG: CommitTransaction < 2015-01-16 08:47:51.134 GMT >DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:47:51.134 GMT >DEBUG: autovacuum: processing database "postgres" < 2015-01-16 08:47:51.135 GMT >DEBUG: received inquiry for database 13003 < 2015-01-16 08:47:51.135 GMT >DEBUG: writing stats file "pg_stat_tmp/global.stat" < 2015-01-16 08:47:51.137 GMT >DEBUG: writing stats file "pg_stat_tmp/db_13003.stat" < 2015-01-16 08:47:51.145 GMT >DEBUG: StartTransaction < 2015-01-16 08:47:51.145 GMT >DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:47:51.145 GMT >DEBUG: pg_statistic: vac: 23 (threshold 130), anl: 42 (threshold 90) < 2015-01-16 08:47:51.145 GMT >DEBUG: pg_type: vac: 0 (threshold 118), anl: 0 (threshold 84) < 2015-01-16 08:47:51.145 GMT >DEBUG: pg_authid: vac: 3 (threshold 50), anl: 5 (threshold 50) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_attribute: vac: 0 (threshold 512), anl: 0 (threshold 281) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_proc: vac: 0 (threshold 587), anl: 0 (threshold 318) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_index: vac: 0 (threshold 73), anl: 0 (threshold 61) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_operator: vac: 0 (threshold 203), anl: 0 (threshold 126) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_opclass: vac: 0 (threshold 76), anl: 0 (threshold 63) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_am: vac: 0 (threshold 51), anl: 0 (threshold 50) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_amop: vac: 0 (threshold 137), anl: 0 (threshold 94) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_amproc: vac: 0 (threshold 119), anl: 0 (threshold 84) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_database: vac: 0 (threshold 50), anl: 1 (threshold 50) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_aggregate: vac: 0 (threshold 77), anl: 0 (threshold 63) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_rewrite: vac: 0 (threshold 72), anl: 0 (threshold 61) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_cast: vac: 0 (threshold 90), anl: 0 (threshold 70) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_namespace: vac: 0 (threshold 51), anl: 0 (threshold 51) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_db_role_setting: vac: 0 (threshold 50), anl: 1 (threshold 50) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_tablespace: vac: 0 (threshold 50), anl: 4 (threshold 50) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_shdepend: vac: 57 (threshold 69), anl: 24 (threshold 59) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_shdescription: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_class: vac: 0 (threshold 109), anl: 0 (threshold 80) < 2015-01-16 08:47:51.146 GMT >DEBUG: pg_toast_2619: vac: 0 (threshold 52), anl: 0 (threshold 51) < 2015-01-16 08:47:51.147 GMT >DEBUG: pg_toast_2618: vac: 0 (threshold 87), anl: 0 (threshold 69) < 2015-01-16 08:47:51.147 GMT >DEBUG: CommitTransaction < 2015-01-16 08:47:51.147 GMT >DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:47:51.147 GMT >DEBUG: shmem_exit(0): 1 before_shmem_exit callbacks to make < 2015-01-16 08:47:51.147 GMT >DEBUG: shmem_exit(0): 7 on_shmem_exit callbacks to make < 2015-01-16 08:47:51.147 GMT >DEBUG: proc_exit(0): 2 callbacks to make < 2015-01-16 08:47:51.147 GMT >DEBUG: exit(0) < 2015-01-16 08:47:51.147 GMT >DEBUG: shmem_exit(-1): 0 before_shmem_exit callbacks to make < 2015-01-16 08:47:51.147 GMT >DEBUG: shmem_exit(-1): 0 on_shmem_exit callbacks to make < 2015-01-16 08:47:51.147 GMT >DEBUG: proc_exit(-1): 0 callbacks to make < 2015-01-16 08:47:51.149 GMT >DEBUG: reaping dead processes < 2015-01-16 08:47:51.149 GMT >DEBUG: server process (PID 1451) exited with exit code 0 < 2015-01-16 08:48:21.149 GMT >DEBUG: StartTransaction < 2015-01-16 08:48:21.149 GMT >DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:48:21.149 GMT >DEBUG: CommitTransaction < 2015-01-16 08:48:21.149 GMT >DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:48:21.150 GMT >DEBUG: received inquiry for database 0 < 2015-01-16 08:48:21.150 GMT >DEBUG: writing stats file "pg_stat_tmp/global.stat" < 2015-01-16 08:48:21.150 GMT >DEBUG: writing stats file "pg_stat_tmp/db_0.stat" < 2015-01-16 08:48:21.161 GMT >DEBUG: InitPostgres < 2015-01-16 08:48:21.161 GMT >DEBUG: my backend ID is 6 < 2015-01-16 08:48:21.161 GMT >DEBUG: StartTransaction < 2015-01-16 08:48:21.162 GMT >DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:48:21.164 GMT >DEBUG: CommitTransaction < 2015-01-16 08:48:21.164 GMT >DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:48:21.164 GMT >DEBUG: autovacuum: processing database "ecce" < 2015-01-16 08:48:21.164 GMT >DEBUG: received inquiry for database 16390 < 2015-01-16 08:48:21.164 GMT >DEBUG: writing stats file "pg_stat_tmp/global.stat" < 2015-01-16 08:48:21.166 GMT >DEBUG: writing stats file "pg_stat_tmp/db_16390.stat" < 2015-01-16 08:48:21.175 GMT >DEBUG: StartTransaction < 2015-01-16 08:48:21.175 GMT >DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:48:21.175 GMT >DEBUG: pg_statistic: vac: 140 (threshold 169), anl: 9089 (threshold 110) < 2015-01-16 08:48:21.175 GMT >DEBUG: pg_type: vac: 122 (threshold 154), anl: 67 (threshold 102) < 2015-01-16 08:48:21.175 GMT >DEBUG: eng_function: vac: 0 (threshold 71), anl: 0 (threshold 61) < 2015-01-16 08:48:21.175 GMT >DEBUG: pg_authid: vac: 3 (threshold 50), anl: 5 (threshold 50) < 2015-01-16 08:48:21.175 GMT >DEBUG: pg_attribute: vac: 329 (threshold 833), anl: 72 (threshold 442) < 2015-01-16 08:48:21.175 GMT >DEBUG: pg_proc: vac: 54 (threshold 587), anl: 101 (threshold 318) < 2015-01-16 08:48:21.175 GMT >DEBUG: pg_attrdef: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.175 GMT >DEBUG: pg_constraint: vac: 25 (threshold 67), anl: 10 (threshold 58) < 2015-01-16 08:48:21.175 GMT >DEBUG: pg_index: vac: 2 (threshold 95), anl: 49 (threshold 72) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_operator: vac: 0 (threshold 203), anl: 0 (threshold 126) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_opclass: vac: 0 (threshold 76), anl: 0 (threshold 63) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_am: vac: 0 (threshold 51), anl: 0 (threshold 50) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_amop: vac: 0 (threshold 137), anl: 0 (threshold 94) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_amproc: vac: 0 (threshold 119), anl: 0 (threshold 84) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_language: vac: 0 (threshold 51), anl: 0 (threshold 50) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_database: vac: 0 (threshold 50), anl: 1 (threshold 50) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_aggregate: vac: 0 (threshold 77), anl: 0 (threshold 63) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_rewrite: vac: 0 (threshold 72), anl: 0 (threshold 61) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_trigger: vac: 28 (threshold 66), anl: 28 (threshold 58) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_event_trigger: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_description: vac: 1 (threshold 787), anl: 37 (threshold 419) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_cast: vac: 0 (threshold 90), anl: 0 (threshold 70) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_namespace: vac: 6 (threshold 51), anl: 8 (threshold 51) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_depend: vac: 634 (threshold 1529), anl: 167 (threshold 790) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_db_role_setting: vac: 0 (threshold 50), anl: 1 (threshold 50) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_tablespace: vac: 0 (threshold 50), anl: 4 (threshold 50) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_shdepend: vac: 57 (threshold 78), anl: 24 (threshold 64) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_shdescription: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_ts_config: vac: 0 (threshold 53), anl: 0 (threshold 52) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_ts_config_map: vac: 0 (threshold 111), anl: 0 (threshold 80) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_ts_dict: vac: 0 (threshold 53), anl: 0 (threshold 52) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_ts_parser: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.176 GMT >DEBUG: pg_ts_template: vac: 0 (threshold 51), anl: 0 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: pg_extension: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: pg_collation: vac: 0 (threshold 224), anl: 0 (threshold 137) < 2015-01-16 08:48:21.177 GMT >DEBUG: pg_class: vac: 103 (threshold 155), anl: 42 (threshold 103) < 2015-01-16 08:48:21.177 GMT >DEBUG: lk_comment_group17: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: ft_activities: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: eng_group: vac: 0 (threshold 69), anl: 0 (threshold 59) < 2015-01-16 08:48:21.177 GMT >DEBUG: pg_inherits: vac: 23 (threshold 51), anl: 5 (threshold 51) < 2015-01-16 08:48:21.177 GMT >DEBUG: eng_group_page: vac: 0 (threshold 296), anl: 0 (threshold 173) < 2015-01-16 08:48:21.177 GMT >DEBUG: fbcomment_test: vac: 0 (threshold 26972), anl: 0 (threshold 13511) < 2015-01-16 08:48:21.177 GMT >DEBUG: eng_group_function: vac: 0 (threshold 545), anl: 0 (threshold 298) < 2015-01-16 08:48:21.177 GMT >DEBUG: eng_module: vac: 0 (threshold 50), anl: 12 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: lk_rule_type: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: lk_sn: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: lk_time_slot: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: lk_comment_group60: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: lk_user_gender: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: lk_object_type: vac: 0 (threshold 50), anl: 14 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: lk_post_type: vac: 0 (threshold 50), anl: 5 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: lk_group: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.177 GMT >DEBUG: lk_page: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_comment_group71: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_post: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: ft_rule_page: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: ft_trend_page: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_rules: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: cfg_wk_data_insert: vac: 37 (threshold 52), anl: 22 (threshold 51) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_gnip_urls: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_comment: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_hashtags: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_comment_group121: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: eng_sn: vac: 0 (threshold 50), anl: 48 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: cfg_data_table_list: vac: 7 (threshold 50), anl: 9 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_comment_group130: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: twuser: vac: 0 (threshold 35574), anl: 0 (threshold 17812) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_user: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_album: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_comment_group150: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_matching_rules: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_user_mentions: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_languages: vac: 0 (threshold 57), anl: 0 (threshold 54) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_comment_group160: vac: 0 (threshold 50), anl: 32 (threshold 50) < 2015-01-16 08:48:21.178 GMT >DEBUG: fbalbum: vac: 0 (threshold 386), anl: 0 (threshold 218) < 2015-01-16 08:48:21.178 GMT >DEBUG: talend_stats: vac: 1 (threshold 203), anl: 87 (threshold 126) < 2015-01-16 08:48:21.178 GMT >DEBUG: lk_comment_group8: vac: 0 (threshold 109), anl: 0 (threshold 79) < 2015-01-16 08:48:21.179 GMT >DEBUG: lk_comment_group16: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.179 GMT >DEBUG: lk_comment_group79: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.179 GMT >DEBUG: lk_comment_group110: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.179 GMT >DEBUG: eng_rt_tw_rule_group: vac: 0 (threshold 648), anl: 0 (threshold 349) < 2015-01-16 08:48:21.179 GMT >DEBUG: fbuser: vac: 0 (threshold 92503), anl: 0 (threshold 46276) < 2015-01-16 08:48:21.179 GMT >DEBUG: talend_flowmeter: vac: 0 (threshold 50), anl: 36 (threshold 50) < 2015-01-16 08:48:21.179 GMT >DEBUG: lk_owner_type: vac: 8 (threshold 50), anl: 9 (threshold 50) < 2015-01-16 08:48:21.179 GMT >DEBUG: fbfeed: vac: 0 (threshold 42234), anl: 0 (threshold 21142) < 2015-01-16 08:48:21.179 GMT >DEBUG: eng_page: vac: 0 (threshold 217), anl: 0 (threshold 133) < 2015-01-16 08:48:21.179 GMT >DEBUG: talend_log: vac: 0 (threshold 67), anl: 20 (threshold 58) < 2015-01-16 08:48:21.179 GMT >DEBUG: cfg_wk_download_page: vac: 0 (threshold 183), anl: 0 (threshold 116) < 2015-01-16 08:48:21.179 GMT >DEBUG: lk_application: vac: 0 (threshold 72), anl: 0 (threshold 61) < 2015-01-16 08:48:21.179 GMT >DEBUG: fblike: vac: 0 (threshold 7473), anl: 0 (threshold 3762) < 2015-01-16 08:48:21.179 GMT >DEBUG: fbalbumlike: vac: 0 (threshold 210), anl: 0 (threshold 130) < 2015-01-16 08:48:21.179 GMT >DEBUG: cfg_io_parameter: vac: 1 (threshold 52), anl: 10 (threshold 51) < 2015-01-16 08:48:21.179 GMT >DEBUG: cfg_table_list: vac: 9 (threshold 52), anl: 19 (threshold 51) < 2015-01-16 08:48:21.179 GMT >DEBUG: twtweet: vac: 0 (threshold 8568), anl: 0 (threshold 4309) < 2015-01-16 08:48:21.179 GMT >DEBUG: fbalbumcomment: vac: 0 (threshold 189), anl: 0 (threshold 120) < 2015-01-16 08:48:21.179 GMT >DEBUG: fbcomment: vac: 0 (threshold 26968), anl: 0 (threshold 13509) < 2015-01-16 08:48:21.180 GMT >DEBUG: tmp_fbuser: vac: 0 (threshold 100049), anl: 0 (threshold 50049) < 2015-01-16 08:48:21.180 GMT >DEBUG: fbdmconversation: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: x: vac: 0 (threshold 50), anl: 1 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: lk_album_comment: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_341306: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_341528: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_2619: vac: 60 (threshold 69), anl: 3634 (threshold 60) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_1255: vac: 37 (threshold 50), anl: 32 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_2618: vac: 0 (threshold 87), anl: 0 (threshold 69) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_341324: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_295391: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_17106: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_17118: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_341333: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_302509: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_341573: vac: 0 (threshold 50), anl: 70442 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_514066: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_340155: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_340186: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_34499: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_340241: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_17157: vac: 0 (threshold 16745), anl: 83474 (threshold 8397) < 2015-01-16 08:48:21.180 GMT >DEBUG: pg_toast_341346: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_340358: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_340460: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_340532: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_340491: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_340571: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_17100: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_340589: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_341132: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_341386: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_17133: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_340607: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_341395: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_51098: vac: 0 (threshold 50), anl: 114 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_34578: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_340633: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_341405: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_340729: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_340672: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_341414: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_17079: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_341315: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_341355: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_341377: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_17181: vac: 0 (threshold 50), anl: 246440 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_17067: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_17139: vac: 0 (threshold 50), anl: 26505 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_341472: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_17169: vac: 0 (threshold 50), anl: 165994 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_17124: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_17073: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_17094: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_341225: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.181 GMT >DEBUG: pg_toast_17175: vac: 0 (threshold 50), anl: 341014 (threshold 50) < 2015-01-16 08:48:21.182 GMT >DEBUG: pg_toast_17151: vac: 0 (threshold 50), anl: 13530 (threshold 50) < 2015-01-16 08:48:21.182 GMT >DEBUG: pg_toast_17187: vac: 0 (threshold 50), anl: 18216 (threshold 50) < 2015-01-16 08:48:21.182 GMT >DEBUG: pg_toast_17145: vac: 0 (threshold 50), anl: 4460 (threshold 50) < 2015-01-16 08:48:21.182 GMT >DEBUG: pg_toast_17088: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.182 GMT >DEBUG: pg_toast_17199: vac: 0 (threshold 50), anl: 15464 (threshold 50) < 2015-01-16 08:48:21.182 GMT >DEBUG: pg_toast_17163: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.182 GMT >DEBUG: pg_toast_17205: vac: 0 (threshold 50), anl: 0 (threshold 50) < 2015-01-16 08:48:21.182 GMT >DEBUG: CommitTransaction < 2015-01-16 08:48:21.182 GMT >DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: < 2015-01-16 08:48:21.183 GMT >DEBUG: shmem_exit(0): 1 before_shmem_exit callbacks to make < 2015-01-16 08:48:21.183 GMT >DEBUG: shmem_exit(0): 7 on_shmem_exit callbacks to make < 2015-01-16 08:48:21.183 GMT >DEBUG: proc_exit(0): 2 callbacks to make < 2015-01-16 08:48:21.183 GMT >DEBUG: exit(0) < 2015-01-16 08:48:21.183 GMT >DEBUG: shmem_exit(-1): 0 before_shmem_exit callbacks to make < 2015-01-16 08:48:21.183 GMT >DEBUG: shmem_exit(-1): 0 on_shmem_exit callbacks to make < 2015-01-16 08:48:21.183 GMT >DEBUG: proc_exit(-1): 0 callbacks to make < 2015-01-16 08:48:21.185 GMT >DEBUG: reaping dead processes < 2015-01-16 08:48:21.185 GMT >DEBUG: server process (PID 1452) exited with exit code 0 TopMemoryContext: 63584 total in 8 blocks; 6592 free (11 chunks); 56992 used TopTransactionContext: 8192 total in 1 blocks; 7312 free (1 chunks); 880 used Record information cache: 24576 total in 2 blocks; 15984 free (5 chunks); 8592 used Type information cache: 24240 total in 2 blocks; 3744 free (0 chunks); 20496 used TableSpace cache: 8192 total in 1 blocks; 3216 free (0 chunks); 4976 used Operator lookup cache: 24576 total in 2 blocks; 11888 free (5 chunks); 12688 used MessageContext: 131072 total in 5 blocks; 4608 free (3 chunks); 126464 used Operator class cache: 8192 total in 1 blocks; 1680 free (0 chunks); 6512 used smgr relation table: 24576 total in 2 blocks; 9808 free (4 chunks); 14768 used TransactionAbortContext: 32768 total in 1 blocks; 32736 free (0 chunks); 32 used Portal hash: 8192 total in 1 blocks; 1680 free (0 chunks); 6512 used PortalMemory: 8192 total in 1 blocks; 7888 free (0 chunks); 304 used PortalHeapMemory: 1024 total in 1 blocks; 800 free (0 chunks); 224 used ExecutorState: 4315656 total in 17 blocks; 63248 free (22 chunks); 4252408 used TIDBitmap: 253952 total in 5 blocks; 42976 free (16 chunks); 210976 used printtup: 8192 total in 1 blocks; 8160 free (0 chunks); 32 used BTree Array Context: 1024 total in 1 blocks; 696 free (0 chunks); 328 used ExprContext: 15936275496 total in 28236 blocks; 7158480 free (6 chunks); 15929117016 used Relcache by OID: 24576 total in 2 blocks; 13872 free (3 chunks); 10704 used CacheMemoryContext: 1064336 total in 8 blocks; 475200 free (0 chunks); 589136 used pg_toast_17157_index: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used pg_toast_2619_index: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used fbcomment_idx: 3072 total in 2 blocks; 1704 free (0 chunks); 1368 used pk_eng_page: 1024 total in 1 blocks; 152 free (0 chunks); 872 used pk_eng_group_page: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used pg_index_indrelid_index: 1024 total in 1 blocks; 152 free (0 chunks); 872 used pg_db_role_setting_databaseid_rol_index: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used pg_user_mapping_user_server_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_user_mapping_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_type_oid_index: 1024 total in 1 blocks; 152 free (0 chunks); 872 used pg_type_typname_nsp_index: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used pg_ts_template_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_ts_template_tmplname_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_ts_parser_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_ts_parser_prsname_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_ts_dict_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_ts_dict_dictname_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_ts_config_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_ts_config_cfgname_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_ts_config_map_index: 3072 total in 2 blocks; 1784 free (2 chunks); 1288 used pg_tablespace_oid_index: 1024 total in 1 blocks; 152 free (0 chunks); 872 used pg_statistic_relid_att_inh_index: 3072 total in 2 blocks; 1736 free (2 chunks); 1336 used pg_class_relname_nsp_index: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used pg_range_rngtypid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_proc_oid_index: 1024 total in 1 blocks; 152 free (0 chunks); 872 used pg_proc_proname_args_nsp_index: 3072 total in 2 blocks; 1736 free (2 chunks); 1336 used pg_opfamily_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_opfamily_am_name_nsp_index: 3072 total in 2 blocks; 1784 free (2 chunks); 1288 used pg_operator_oid_index: 1024 total in 1 blocks; 152 free (0 chunks); 872 used pg_operator_oprname_l_r_n_index: 3072 total in 2 blocks; 1736 free (2 chunks); 1336 used pg_namespace_oid_index: 1024 total in 1 blocks; 152 free (0 chunks); 872 used pg_namespace_nspname_index: 1024 total in 1 blocks; 152 free (0 chunks); 872 used pg_language_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_language_name_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_foreign_table_relid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_foreign_server_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_foreign_server_name_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_foreign_data_wrapper_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_foreign_data_wrapper_name_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_event_trigger_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_event_trigger_evtname_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_enum_typid_label_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_enum_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_default_acl_role_nsp_obj_index: 3072 total in 2 blocks; 1784 free (2 chunks); 1288 used pg_conversion_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_constraint_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_conversion_name_nsp_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_conversion_default_index: 3072 total in 2 blocks; 1784 free (2 chunks); 1288 used pg_collation_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_collation_name_enc_nsp_index: 3072 total in 2 blocks; 1784 free (2 chunks); 1288 used pg_opclass_am_name_nsp_index: 3072 total in 2 blocks; 1736 free (2 chunks); 1336 used pg_cast_source_target_index: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used pg_auth_members_role_member_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_attribute_relid_attnam_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_amop_fam_strat_index: 3072 total in 2 blocks; 1736 free (2 chunks); 1336 used pg_amop_opr_fam_index: 3072 total in 2 blocks; 1736 free (2 chunks); 1336 used pg_aggregate_fnoid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_auth_members_member_role_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_authid_oid_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_authid_rolname_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_database_oid_index: 1024 total in 1 blocks; 152 free (0 chunks); 872 used pg_database_datname_index: 1024 total in 1 blocks; 200 free (0 chunks); 824 used pg_trigger_tgrelid_tgname_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_rewrite_rel_rulename_index: 1024 total in 1 blocks; 64 free (0 chunks); 960 used pg_amproc_fam_proc_index: 3072 total in 2 blocks; 1736 free (2 chunks); 1336 used pg_opclass_oid_index: 1024 total in 1 blocks; 152 free (0 chunks); 872 used pg_index_indexrelid_index: 1024 total in 1 blocks; 152 free (0 chunks); 872 used pg_attribute_relid_attnum_index: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used pg_class_oid_index: 1024 total in 1 blocks; 152 free (0 chunks); 872 used MdSmgr: 8192 total in 1 blocks; 6688 free (0 chunks); 1504 used ident parser context: 0 total in 0 blocks; 0 free (0 chunks); 0 used hba parser context: 7168 total in 3 blocks; 3184 free (2 chunks); 3984 used LOCALLOCK hash: 8192 total in 1 blocks; 1680 free (0 chunks); 6512 used Timezones: 83472 total in 2 blocks; 3744 free (0 chunks); 79728 used ErrorContext: 8192 total in 1 blocks; 8160 free (4 chunks); 32 used < 2015-01-16 08:48:42.816 GMT >ERROR: out of memory < 2015-01-16 08:48:42.816 GMT >DETAIL: Failed on request of size 524288. < 2015-01-16 08:48:42.816 GMT >STATEMENT: SELECT CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN field_id ->'comment'->>'id' WHEN '[' THEN jsonb_array_elements(field_id ->'comment')->>'id' ELSE NULL END AS comment_id, CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN field_id ->'comment'->'from'->>'id' WHEN '[' THEN jsonb_array_elements(field_id ->'comment')->'from'->>'id' ELSE NULL END AS user_id, field_id ->> '_id' post_id, CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN (field_id ->'comment'->>'created_timestamp')::timestamp without time zone WHEN '[' THEN (jsonb_array_elements(field_id ->'comment')->>'created_time')::timestamp without time zone ELSE NULL END AS comment_create_date, CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN cast(to_char((field_id ->'comment'->>'created_time')::timestamp without time zone,'YYYYMMDD') as numeric) WHEN '[' THEN cast(to_char((jsonb_array_elements(field_id ->'comment')->>'created_time')::timestamp without time zone,'YYYYMMDD') as numeric) ELSE NULL END AS comment_created_day, field_id ->> 'pageId' page_id, CASE substring(field_id->>'feedtype',1,1) WHEN 'f' THEN 2 WHEN 'b' THEN 1 ELSE 3 END AS owner_type, 'WALL' comment_type, CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN to_char((field_id ->'comment'->>'created_time')::timestamp without time zone,'HH24')::numeric WHEN '[' THEN to_char((jsonb_array_elements(field_id ->'comment')->>'created_time')::timestamp without time zone,'HH24')::numeric ELSE NULL END AS comment_time_slot, CASE substring((field_id ->'comment')::text,1,1) WHEN '{' THEN (field_id ->'comment'->>'like_count')::numeric WHEN '[' THEN (jsonb_array_elements(field_id ->'comment')->>'like_count')::numeric ELSE NULL END AS like_count, 1 as sn_id, 17 AS group_id FROM ecce_stage.fbcomment WHERE field_id ->> 'pageId' in ('110686168966251', '124858950920112', '164913773543444', '190178617688826', '142553345763418') ; > Maybe you can generate some artificial data that produces the problem? I've asked permission for these data Enrico -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general From enrico.bianchi@ymail.com Fri Jan 16 08:59:22 2015 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YC2kU-0004Wz-H1 for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 08:59:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YC2kU-0008AM-0E for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 08:59:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YC2kS-00088L-3n for pgsql-general@postgresql.org; Fri, 16 Jan 2015 08:59:20 +0000 Received: from nm37.bullet.mail.ir2.yahoo.com ([212.82.96.62]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YC2kP-0000XH-0a for pgsql-general@postgresql.org; Fri, 16 Jan 2015 08:59:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1421398755; bh=MfV6pgzUeS2X9tUGR0Xu+SgRoxQxj5d3Kn7hxTCxDc0=; h=Date:From:To:Subject:References:In-Reply-To:From:Subject; b=mCimPWE/9bP7gWJ8kcqfwZEo8qGaaAmryet85RDqH6xDYPTjX/m4atkm0XE0WQJMM4DsmFndQH95Z3XhXVnbxnK9M+inYwBvKDIaMykj5y6nThhq4gY7aeidAzRx6ABvbDfOHfh8XPQ8IKwbjh2XO54oUtmmMNDo41vagIQxAkZCY69FDvINSjfivl2AIh3pzQKIprVf6SSlkJyZWiZk1QVYjGYQ1WM+5jHNUbF9ylNcGwmE/wDFMjWjZIEMMcuWTwtazBI+snXkgQKOtkJuCd2uG98aXfvNvMzYIbuEMFePTeC7aNWKjmN5t+wrntPRqt2wy4QZzKicpsmMu9qVRw== Received: from [212.82.98.52] by nm37.bullet.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 08:59:15 -0000 Received: from [46.228.39.82] by tm5.bullet.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 08:59:14 -0000 Received: from [127.0.0.1] by smtp119.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 08:59:14 -0000 X-Yahoo-Newman-Id: 805366.2115.bm@smtp119.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: SKaI5EwVM1l4J2wu9gdNxZsSUqkAssXehnRcAuaorJ5L13B 3Xd54PDxcuojtRjPS.E9yqjxO2p.G7dsnmwesCISw4oOMAZR2b2LqF7ihgob lZYcYR6UpRGj8d5umafNTgu0y5.PYkGx_QtqQ6Cog7ilSCBSraTVTSb3BYTZ OUZlVDw9YWjvpXDNAz_82Nze_ZIgRbU_gY1Fys81GZGhZ9hp.xyMRNBIkfHN JNITX7EU778lNMkP1pFtpKmokh8d6rL0aZFu2AxDqHhyufeUO8aAf43JF_DP .i2tIHWl7Ko7b6tL6VPDJXuYe2tznFO1JU.01KMqQBu8KyvD.C0zUgQOumEq JH_hxUAHrhKwbND.EkQBHpH8.JDifD6Qc2K7E8awgyJJX1VguzNNG221joxO NivW0yLR8C5.tFoIaRNe9mba7gvLmWFd3kfQadohrW_CsLejfhAuxcLZWAEs C40vwKmLY_NNMtd2W6m_FeZUMF9lzyCqt6_0wSRRrHumFV9Q75sNH0NylfCL jcEXrZf8iRASmVe7yN97m.tmhFH3S5d5aVMVxoQeEco0JWF5BzQ98sPw- X-Yahoo-SMTP: 3uDVuluswBBbOWxip8ozdb.._tg10pMkLWhFGuowizMhZ4W.SQ-- Message-ID: <54B8D2E1.4060907@ymail.com> Date: Fri, 16 Jan 2015 09:59:13 +0100 From: Enrico Bianchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: Out of Memory References: <54B84A83.9020003@ymail.com> <54B85928.6030401@hogranch.com> In-Reply-To: <54B85928.6030401@hogranch.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 01/16/2015 01:19 AM, John R Pierce wrote: > you didn't do EXPLAIN ANALYZE, so your query plan statistics are all > estimates. I know, but the EXPLAIN ANALYZE has the same problem of the query Enrico -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general From enrico.bianchi@ymail.com Fri Jan 16 10:22:50 2015 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YC43G-0007RW-80 for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 10:22:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YC43F-0001tp-59 for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 10:22:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YC43C-0001tg-DN for pgsql-general@postgresql.org; Fri, 16 Jan 2015 10:22:46 +0000 Received: from nm11-vm2.bullet.mail.ir2.yahoo.com ([212.82.96.163]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YC438-0002GO-LF for pgsql-general@postgresql.org; Fri, 16 Jan 2015 10:22:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1421403755; bh=vFKRttM5r6hLS/V7RifPtT04nbGwhrFEi0iMxLJpw94=; h=Date:From:To:Subject:References:In-Reply-To:From:Subject; b=XK2jq0PlaVkWIcROkWUUKDXPx4fxlKacE1oyNcaA1ctL/tUNjm+IbYO3AdCewtm/PIKDGI8vGpwfeflU8bmsdcq2dRSIfiOKpIr4fwu9hNpaBFn0vLxy2gPOQkZGg+PkiOz00pOfywo6xm2WOTjBbYfRXaYswcjPOlR4cxKf4XVd5TVue4VRyoFoGuV43B/BGAj6DMT0Am8etOfvHxSFbUM+z52a2MJ0kDoWUiyAgLhnLD4zGs7XA/xNgfDX0YALAppeCsZqY8jOJOLXN6TJjZ1zAqymWSKV8Dqn5oLO2NBhiTHpP3rTSHVSoeKub53Aur04Vdm7A7bizIsrM0Dnzg== Received: from [212.82.98.63] by nm11.bullet.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 10:22:35 -0000 Received: from [46.228.39.73] by tm16.bullet.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 10:22:33 -0000 Received: from [127.0.0.1] by smtp110.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 10:22:33 -0000 X-Yahoo-Newman-Id: 599905.39831.bm@smtp110.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: LpKdKmkVM1muC1rbvUPuqBnVmdjSTIcu3mQpXOZlLSvMpsN zu_Qq7_7gOB4ftzy1TpSwiN6UWo19uGj6kbV6XpEUgy9ljZ7OT2gfFe43IJ7 9Uo7NgoFPKPu6n8oY.7NyNkmVV.0M5LGmvxXZ7I_vxZwhMcc3.iQPgk_9QZC eme2LdG8FNCAH39ect1WEHSdf4qoB.U0YYoAtb63YnnP2jtNl5ENMcjqQmp0 Jc_mYfPk9s.CoGmiHhM1a1G__rzaq0ihnJEsbiIjraHHDaLXpXZEDGm.785X g7.fGBuOTAkBhI5MZgbYRTLkXW8F1LmlNVptrYc2FLgYxSxdKlV10X7AuSj6 50rlVz0LYWeZObyzHVtaMR0AzND6.Yt13njrdxXQPFWdKc8OdF2lkB5k68e5 IO5lv5q3gzeLhzu1MHg2NBUxLEyjshpKhvdRXHQU0RexuYbjCndBTQGnR.Kp Cyqp9l1kDe48Y.cHGC9Lmbmam0vWaERSTYeXwTzNmkTwv_.gwAFo4CKymVBG HDbvOqezBu2KzMumBpNk_bbTZtutkaMDmFr25g.o_yn8VAB4Rv.ScbDVoio2 s.k4KHV8L0acqI6e.YARV9y96fzDM5nTnMTVmXWOhiEgLpmDVk5t2okXuJBG UKiW7.IPqJAhExQahbDmM.o15RClk2Juz7Xxhyuotsb3y.U.F4aJWCujSH0u H.61xnfpFtUbyOSppC9pD X-Yahoo-SMTP: 3uDVuluswBBbOWxip8ozdb.._tg10pMkLWhFGuowizMhZ4W.SQ-- Message-ID: <54B8E668.6070302@ymail.com> Date: Fri, 16 Jan 2015 11:22:32 +0100 From: Enrico Bianchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: Out of Memory References: <54B84A83.9020003@ymail.com> <3681.1421371129@sss.pgh.pa.us> <54B8D2A8.4090904@ymail.com> In-Reply-To: <54B8D2A8.4090904@ymail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.6 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 01/16/2015 09:58 AM, Enrico Bianchi wrote: > I've asked permission for these data I've obtained the permission, here is available a subset of data large enough to replicate the problem (note: you can simply run the query without the where clause): https://drive.google.com/file/d/0ByfjZX4TabhocUg2MFJ6a21qS2M/view?usp=sharing Enrico -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general From enrico.bianchi@ymail.com Fri Jan 16 11:57:48 2015 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YC5XA-0002PV-5u for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 11:57:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YC5X9-0002Sb-MA for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 11:57:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YC5X7-0002SU-Us for pgsql-general@postgresql.org; Fri, 16 Jan 2015 11:57:46 +0000 Received: from nm34-vm9.bullet.mail.ir2.yahoo.com ([212.82.97.123]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YC5Wx-0003tY-02 for pgsql-general@postgresql.org; Fri, 16 Jan 2015 11:57:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1421409451; bh=uU+u5+pxpD8tcjz4jwoEL/miJdx0iOre9Zqgf/ql3Ps=; h=Date:From:To:Subject:References:In-Reply-To:From:Subject; b=aB6hsUCluYh4CubxQs4EtMnKp0+sj83LH3q5jZCqVgxdHudn6/06eKhKkLusXdAE+JOTJsN4Qp9TIkvF6EYW0VgxA2QaiaJWWlDt7Y3k//ZAnp73vMVXQq7tgMUE8Fdn9RTaT+eQCVyRStxoIYcFRilZ+ZbW10VVSBL6FZNWk5qWc0ANAqEh/s8RHEgeWwjkZrPoMsoMU1hf69uhJlzO8CH/dZRJjDADj29bbWGtyRbUWeLQBGFHhRa86e/G0FtYvABG0cwJ7406sn6KjAGKkV2UW8B2rZoOuN0sKzu+yjw6a4PUMZo3erqO0F+GP9phUXze966k2PfMtm5jAtYXAw== Received: from [212.82.98.58] by nm34.bullet.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 11:57:31 -0000 Received: from [46.228.39.111] by tm11.bullet.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 11:57:31 -0000 Received: from [127.0.0.1] by smtp148.mail.ir2.yahoo.com with NNFMP; 16 Jan 2015 11:57:31 -0000 X-Yahoo-Newman-Id: 570665.88321.bm@smtp148.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: HYCDQpkVM1m0WT8aXKM7EtCSfMWnmqFJ0w0PZQU0BQYnZw9 eBbFVboTzc4Zt6askQD6JPLq.MB9_W6WOaEMeCTSrsBXwH0CeJcSRqBA9.V9 wwn5qMp1mR9QBt54vwmaa8J30LzypnFSdLi6gQ2bJYyui0HsWuKRYB4e2Qar nC4oQ2Ogfg1AzpX1ASEIWju9ZM6ua2XYHN2CR8yWCzm4M3gYs6wGnJOUbaEK 2mGuuH.C4hZH3phSqMeYQLDTW6vBdWYm.tGG4CsVedX9qpAH1CjKjn2VVPiv VbBrZ9q9AHRvMVgL.yFQRkI7D7EXjsTX256E3_Mw0TTDKmgF0tXcHL_dgH7_ Pn2jIpFoWHRK.gkRURl.CT.JmLuvWrJ.L0tthP9fwlUBPCVOiEUxHKj9WMgr Z_YZAxlOmMvNfU90.F.Hjp0fHpx6K21S4eyHenhgkLm5njEw.3468SxEOTkO o7FPAxXwmE.QAMXGJ.k4jVqYk6Yv0aYd8KLifvLUC_gYRsLcPxU4wKMTo5Nf lSuTd9o9eMtauWy.T7U_BRynhQXDK1cyG1zJC1O7fXS8WK6r.MQjKzEgXchy gRXbVGiZ0l88kHnY8iC44gYagNxCrOvSvx378VuU6_zQAyQuKFsHJb1v1MzL LSu3ooRjSF_SqfPN5uqZI6qXtlgCjggfJHofSSU7TeqfjGsMkuBue5_Qmtan rvmh2O9rofaxObun2Cf1..w-- X-Yahoo-SMTP: 3uDVuluswBBbOWxip8ozdb.._tg10pMkLWhFGuowizMhZ4W.SQ-- Message-ID: <54B8FCAA.1020500@ymail.com> Date: Fri, 16 Jan 2015 12:57:30 +0100 From: Enrico Bianchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: Out of Memory References: <54B84A83.9020003@ymail.com> <3681.1421371129@sss.pgh.pa.us> <54B8D2A8.4090904@ymail.com> <54B8E668.6070302@ymail.com> In-Reply-To: <54B8E668.6070302@ymail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 01/16/2015 11:22 AM, Enrico Bianchi wrote: > https://drive.google.com/file/d/0ByfjZX4TabhocUg2MFJ6a21qS2M/view?usp=sharing > Note: due an error in dump script, if you are in Linux/Unix environment, use this command for uncompressing the file: bzip2 -d -c comment_test.dump.bz2 |sed -e '12d' > comment_test.dump Enrico -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general From chris@1006.org Fri Jan 16 14:38:10 2015 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YC82M-0007xE-GM for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 14:38:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YC82L-0001BJ-Qe for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 14:38:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YC82K-00018g-6o for pgsql-general@postgresql.org; Fri, 16 Jan 2015 14:38:08 +0000 Received: from smtp1.hushmail.com ([65.39.178.135]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YC82G-0006yP-Cs for pgsql-general@postgresql.org; Fri, 16 Jan 2015 14:38:06 +0000 Received: from smtp1.hushmail.com (localhost [127.0.0.1]) by smtp1.hushmail.com (Postfix) with SMTP id 6A13040147 for ; Fri, 16 Jan 2015 14:38:02 +0000 (UTC) X-hush-tls-connected: 1 Received: from smtp.hushmail.com (w5.hushmail.com [65.39.178.80]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.hushmail.com (Postfix) with ESMTPS; Fri, 16 Jan 2015 14:38:02 +0000 (UTC) Message-ID: Date: Fri, 16 Jan 2015 15:37:58 +0100 From: Chris Mair User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Enrico Bianchi , pgsql-general@postgresql.org Subject: Re: Out of Memory References: <54B84A83.9020003@ymail.com> <3681.1421371129@sss.pgh.pa.us> <54B8D2A8.4090904@ymail.com> <54B8E668.6070302@ymail.com> <54B8FCAA.1020500@ymail.com> In-Reply-To: <54B8FCAA.1020500@ymail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org >> https://drive.google.com/file/d/0ByfjZX4TabhocUg2MFJ6a21qS2M/view?usp=sharing > Note: due an error in dump script, if you are in Linux/Unix environment, use this command for uncompressing the file: > > bzip2 -d -c comment_test.dump.bz2 |sed -e '12d' > comment_test.dump Hi, I've played a bit with this. Here's what I see. Let me give a bit of info: enrico=# \d stage.fbcomment Table "stage.fbcomment" Column | Type | Modifiers ----------+-------+----------- field_id | jsonb | Indexes: "comment_test_idx" btree ((field_id ->> 'pageId'::text)) enrico=# select pg_total_relation_size('stage.fbcomment'); pg_total_relation_size ------------------------ 83755008 (1 row) enrico=# select count(*) from stage.fbcomment; count ------- 23431 (1 row) enrico=# select sum(jsonb_array_length(field_id ->'comment')) from stage.fbcomment; sum -------- 541454 (1 row) -> to keep in mind: there are 23k rows, but if you unnest the 'comment' array there are 541k rows. The following two queries are just fine. I see the postgres worker reaching a "RES" size of 108MB for both. nrico=# explain analyze enrico-# SELECT substring((field_id ->'comment')::text,1,1) enrico-# FROM stage.fbcomment; QUERY PLAN ------------------------------------------------------------------------------------------------------------------- Seq Scan on fbcomment (cost=0.00..3012.62 rows=23431 width=828) (actual time=0.147..2749.940 rows=23431 loops=1) Planning time: 0.046 ms Execution time: 2756.881 ms (3 rows) Time: 2757.398 ms enrico=# enrico=# explain analyze enrico-# SELECT jsonb_array_elements(field_id ->'comment')->>'id' enrico-# FROM stage.fbcomment; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- Seq Scan on fbcomment (cost=0.00..14552.39 rows=2343100 width=828) (actual time=0.067..885.041 rows=541454 loops=1) Planning time: 0.053 ms Execution time: 978.161 ms (3 rows) Time: 978.705 ms Interestingly, if you combine these, it quickly blows up! The following query with a limit 1000 already has a RES of well over 1GB. With larger limits it quickly thrashes my machine. enrico=# explain analyze SELECT substring((field_id ->'comment')::text,1,1), jsonb_array_elements(field_id ->'comment')->>'id' FROM stage.fbcomment limit 1000; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- Limit (cost=0.00..6.31 rows=1000 width=828) (actual time=0.200..2419.749 rows=1000 loops=1) -> Seq Scan on fbcomment (cost=0.00..14786.70 rows=2343100 width=828) (actual time=0.198..2418.931 rows=1000 loops=1) Planning time: 0.059 ms Execution time: 2659.065 ms (4 rows) Time: 2659.708 ms I think this triggers some code path that is not really optimal for memory usage for some reason. I don't know if there is something interesting to fix here or not. I guess other people will quickly see what happens here? In any case the solution for you might be to unnest the comments in this table and split the '{' vs '[' before doing your processing. I.e. create the intermediate table with the 541454 comments and then throw your queries against that table. This should also use way less processing time than the hack with the '[' vs '{' cases. Bye, Chris. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general From tgl@sss.pgh.pa.us Fri Jan 16 16:23:54 2015 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YC9gg-0003Mk-Gg for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 16:23:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YC9gf-0002AE-UQ for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2015 16:23:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YC9gd-0002A5-Lb for pgsql-general@postgresql.org; Fri, 16 Jan 2015 16:23:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YC9ga-0000WK-69 for pgsql-general@postgresql.org; Fri, 16 Jan 2015 16:23:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t0GGNg0M027899; Fri, 16 Jan 2015 11:23:42 -0500 From: Tom Lane To: Chris Mair cc: Enrico Bianchi , pgsql-general@postgresql.org Subject: Re: Out of Memory In-reply-to: References: <54B84A83.9020003@ymail.com> <3681.1421371129@sss.pgh.pa.us> <54B8D2A8.4090904@ymail.com> <54B8E668.6070302@ymail.com> <54B8FCAA.1020500@ymail.com> Comments: In-reply-to Chris Mair message dated "Fri, 16 Jan 2015 15:37:58 +0100" Date: Fri, 16 Jan 2015 11:23:42 -0500 Message-ID: <27898.1421425422@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Chris Mair writes: > ... > Interestingly, if you combine these, it quickly blows up! The following query with a limit 1000 already > has a RES of well over 1GB. With larger limits it quickly thrashes my machine. > enrico=# explain analyze > SELECT substring((field_id ->'comment')::text,1,1), > jsonb_array_elements(field_id ->'comment')->>'id' > FROM stage.fbcomment limit 1000; Yeah. The key point here is that jsonb_array_elements() returns a set, that is one tuple per array element. We've semi-deprecated use of set-returning functions in SELECT output lists, and one of the reasons is that memory management in the presence of set-returning functions is a mess: we can't clear the SELECT's expression-evaluation context until the SRF is done returning rows. Some of the rows in this dataset contain 'comment' arrays with over 1000 elements; that means that the "substring()" expression gets executed over 1000 times without any opportunity to reclaim memory. And that expression will leak a pretty fair amount of memory when dealing with a large field_id value. Multiply that by the fact that the original query does this half a dozen times, and you have a fairly large peak memory consumption. The space does get reclaimed after each original table row, but that's no comfort if you ran out before that. It would probably be possible to go through the JSONB code and reduce (though not eliminate) its appetite for memory in this sort of situation --- for instance, freeing detoasted input arguments would help a lot. But that's not likely to happen overnight. In any case, you're right that this is a very inefficiently expressed query; refactoring things so that the jsonb_array_elements() call is done just once in a subquery would probably help a great deal. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general From greigwise@comcast.net Thu Sep 20 22:11:32 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g37Al-0002l8-Kx for pgsql-general@arkaria.postgresql.org; Thu, 20 Sep 2018 22:11:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g37Aj-0001us-6H for pgsql-general@arkaria.postgresql.org; Thu, 20 Sep 2018 22:11:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g37Ai-0001uk-Uc for pgsql-general@lists.postgresql.org; Thu, 20 Sep 2018 22:11:40 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g37Ad-0000Cz-Gj for pgsql-general@postgresql.org; Thu, 20 Sep 2018 22:11:40 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 810E2F42C3A0 for ; Thu, 20 Sep 2018 15:11:32 -0700 (MST) Date: Thu, 20 Sep 2018 15:11:32 -0700 (MST) From: greigwise To: pgsql-general@postgresql.org Message-ID: <1537481492525-0.post@n3.nabble.com> Subject: Out of Memory MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, I'm running postgres 9.6.10 on Centos 7. Seeing the occasional out of memory error trying to run a query. In the logs I see something like this: Grand total: 462104832 bytes in 795 blocks; 142439136 free (819860 chunks); 319665696 used 2018-09-20 18:08:01 UTC xxxx 5ba3e1a2.7a8a dbname ERROR: out of memory 2018-09-20 18:08:01 UTC xxxx 5ba3e1a2.7a8a dbname DETAIL: Failed on request of size 2016. If I have 142439136 free, then why am I failing on a request of size 2016? Am I misunderstanding here? Thanks, Greig Wise -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html From paul.carlucci@gmail.com Thu Sep 20 22:16:28 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g37Fg-0002x3-2l for pgsql-general@arkaria.postgresql.org; Thu, 20 Sep 2018 22:16:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g37Fd-0004kq-NY for pgsql-general@arkaria.postgresql.org; Thu, 20 Sep 2018 22:16:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g37Fd-0004kj-9o for pgsql-general@lists.postgresql.org; Thu, 20 Sep 2018 22:16:45 +0000 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g37Fa-0000KR-8b for pgsql-general@postgresql.org; Thu, 20 Sep 2018 22:16:44 +0000 Received: by mail-ot1-x32f.google.com with SMTP id v44-v6so11031032ote.13 for ; Thu, 20 Sep 2018 15:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=T8AnxMYaBsPYkH8UP5ZNM/G5nvML+Az9gjlutJ3gJ1s=; b=Wui6xvFFm7eZTJpkqXmuYWVntgH4xrDxuVyczd3LoVYC2fPjEa/AbOn4jz0bJawzlF f/fICDgPdMxBnU9EFL+Q3FEf1vK75Z/8i+uXIfAOTG5dn5jiJPTMtp8RGl4hHk12IGgS sPj+Qvvcq21LWg7dxpuYTth72qIFq79u1UaBNnftZHfhv/hKU9MXCpLPs3R43hsrbVqE 5gPVe+OmuxFBxO+p1gkuxRXJpA5E8qfv0ucRa7KBffSIzvnnpLkyqzD+QHb43nit8RBD BnYPHvoEQy7m4m1nouvDZh9ySZqUV90sbygVDtOE6fW4qXq8IS4UlhGolQ1BoOZsLo/k oC9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=T8AnxMYaBsPYkH8UP5ZNM/G5nvML+Az9gjlutJ3gJ1s=; b=a+/JNGNhLnqZqX/cex4DdbLCsPg2/MGd+tgrhgG60FUH9GzfL8i3SwI9KKyPNPEMxE znajZgfO+DDgYvXHPnm7W/DuMXZEg4IqQ/KMa0jfHH5TUpveUmefR08NfbFoWRoyCUqb pT1PcB4J5D2Ya3OecdFEjeGOSf6ggAb5WQXnPBhKgMWjSqIcMbc0zQF75MOFOH8YwWrb Qz5UQXvtmbSCsmBgqTpbZ/eKoeppgGrIH6/CqKOnzn7Dc+CsvFnJpKBm5+p5oX1C6bRc Id4Aa8BLU/TANviYtUeSsZLq7lldVgjrkrHb//qg0MBeclfWx/OBk27UWOCaWh09I7LK 7EUw== X-Gm-Message-State: APzg51CNUu3XWrgFk9o9iXAa7kUg9zSHq/OsO7OmjeofjnOB5jx2moOr NIFdmbc2fK1c/cMNyCJqIJLBz7uOKCp4Ly88WkM= X-Google-Smtp-Source: ANB0VdYNhjHec0NG5FB9ZrqigoZVu78O1TFVDTJVNEEE5zN7PO45e2+AJTBk4tiI6EzZB6oZPolMHwn/AGmJeaJa5f4= X-Received: by 2002:a9d:2993:: with SMTP id n19-v6mr23907986otb.293.1537481800257; Thu, 20 Sep 2018 15:16:40 -0700 (PDT) MIME-Version: 1.0 References: <1537481492525-0.post@n3.nabble.com> In-Reply-To: <1537481492525-0.post@n3.nabble.com> From: Paul Carlucci Date: Thu, 20 Sep 2018 18:16:28 -0400 Message-ID: Subject: Re: Out of Memory To: greigwise Cc: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="0000000000008d97be057654e0d7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000008d97be057654e0d7 Content-Type: text/plain; charset="UTF-8" My first two guesses are ulimit or numa. numactl --hardware will show your how many nodes your box has and if you're exhausting any of them. On Thu, Sep 20, 2018, 6:11 PM greigwise wrote: > Hello, I'm running postgres 9.6.10 on Centos 7. Seeing the occasional out > of memory error trying to run a query. In the logs I see something like > this: > > Grand total: 462104832 bytes in 795 blocks; 142439136 free (819860 chunks); > 319665696 used > 2018-09-20 18:08:01 UTC xxxx 5ba3e1a2.7a8a dbname ERROR: out of memory > 2018-09-20 18:08:01 UTC xxxx 5ba3e1a2.7a8a dbname DETAIL: Failed on > request > of size 2016. > > If I have 142439136 free, then why am I failing on a request of size 2016? > > Am I misunderstanding here? > > Thanks, > Greig Wise > > > > -- > Sent from: > http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html > > --0000000000008d97be057654e0d7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
My first two guesses are ulimit or numa.=C2=A0 numactl --= hardware will show your how many nodes your box has and if you're exhau= sting any of them.

On = Thu, Sep 20, 2018, 6:11 PM greigwise <greigwise@comcast.net> wrote:
Hello, I'm running postgres 9.6.10 on Centos 7.=C2=A0 =C2=A0Se= eing the occasional out
of memory error trying to run a query.=C2=A0 =C2=A0In the logs I see someth= ing like
this:

Grand total: 462104832 bytes in 795 blocks; 142439136 free (819860 chunks);=
319665696 used
2018-09-20 18:08:01 UTC xxxx 5ba3e1a2.7a8a dbname ERROR:=C2=A0 out of memor= y
2018-09-20 18:08:01 UTC xxxx 5ba3e1a2.7a8a dbname DETAIL:=C2=A0 Failed on r= equest
of size 2016.

If I have 142439136 free, then why am I failing on a request of size 2016?<= br>
Am I misunderstanding here?

Thanks,
Greig Wise



--
Sent from: http://www.p= ostgresql-archive.org/PostgreSQL-general-f1843780.html

--0000000000008d97be057654e0d7-- From greigwise@comcast.net Thu Sep 20 22:22:04 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g37Ky-00039R-85 for pgsql-general@arkaria.postgresql.org; Thu, 20 Sep 2018 22:22:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g37Kv-0007fV-SC for pgsql-general@arkaria.postgresql.org; Thu, 20 Sep 2018 22:22:13 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g37Kv-0007fJ-GE for pgsql-general@lists.postgresql.org; Thu, 20 Sep 2018 22:22:13 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g37Kn-0004o3-R2 for pgsql-general@postgresql.org; Thu, 20 Sep 2018 22:22:12 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id EFF70F42CA73 for ; Thu, 20 Sep 2018 15:22:04 -0700 (MST) Date: Thu, 20 Sep 2018 15:22:04 -0700 (MST) From: greigwise To: pgsql-general@postgresql.org Message-ID: <1537482124935-0.post@n3.nabble.com> In-Reply-To: References: <1537481492525-0.post@n3.nabble.com> Subject: Re: Out of Memory MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ulimit -a for the postgres user shows memory unlimited. numactl --hardware gives command not found. Thanks again. Greig -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html From tgl@sss.pgh.pa.us Thu Sep 20 22:51:11 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g37n6-0004Ng-CJ for pgsql-general@arkaria.postgresql.org; Thu, 20 Sep 2018 22:51:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g37n4-00089T-Jv for pgsql-general@arkaria.postgresql.org; Thu, 20 Sep 2018 22:51:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g37n4-00089M-8d for pgsql-general@lists.postgresql.org; Thu, 20 Sep 2018 22:51:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g37n1-0005Se-Si for pgsql-general@postgresql.org; Thu, 20 Sep 2018 22:51:17 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8KMpBYg016505; Thu, 20 Sep 2018 18:51:11 -0400 From: Tom Lane To: greigwise cc: pgsql-general@postgresql.org Subject: Re: Out of Memory In-reply-to: <1537481492525-0.post@n3.nabble.com> References: <1537481492525-0.post@n3.nabble.com> Comments: In-reply-to greigwise message dated "Thu, 20 Sep 2018 15:11:32 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16503.1537483871.1@sss.pgh.pa.us> Date: Thu, 20 Sep 2018 18:51:11 -0400 Message-ID: <16504.1537483871@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk greigwise writes: > Hello, I'm running postgres 9.6.10 on Centos 7. Seeing the occasional out > of memory error trying to run a query. In the logs I see something like > this: > Grand total: 462104832 bytes in 795 blocks; 142439136 free (819860 chunks); > 319665696 used > 2018-09-20 18:08:01 UTC xxxx 5ba3e1a2.7a8a dbname ERROR: out of memory > 2018-09-20 18:08:01 UTC xxxx 5ba3e1a2.7a8a dbname DETAIL: Failed on request > of size 2016. > If I have 142439136 free, then why am I failing on a request of size 2016? The free space must be in contexts other than the one that last little request wanted space in. Overall, you've got about 460MB of space consumed in that session, so it's not *that* surprising that you got OOM. (At least, it's unsurprising on a 32-bit machine. If the server is 64-bit I'd have thought the kernel would be a bit more liberal.) But anyway, this looks like a mighty inefficient usage pattern at best, and maybe a memory leak at worst. Can you create a self-contained test case that does this? regards, tom lane From greigwise@comcast.net Fri Sep 21 13:20:21 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g3LMF-0001Oh-Qk for pgsql-general@arkaria.postgresql.org; Fri, 21 Sep 2018 13:20:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g3LMD-0001Po-Ci for pgsql-general@arkaria.postgresql.org; Fri, 21 Sep 2018 13:20:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g3LMD-0001PY-4L for pgsql-general@lists.postgresql.org; Fri, 21 Sep 2018 13:20:29 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g3LM7-0005QM-RX for pgsql-general@postgresql.org; Fri, 21 Sep 2018 13:20:28 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 4CFE3F4594AA for ; Fri, 21 Sep 2018 06:20:21 -0700 (MST) Date: Fri, 21 Sep 2018 06:20:21 -0700 (MST) From: greigwise To: pgsql-general@postgresql.org Message-ID: <1537536021272-0.post@n3.nabble.com> In-Reply-To: <16504.1537483871@sss.pgh.pa.us> References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> Subject: Re: Out of Memory MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Well, we are 64-bit.... I'll see if I can make some kind of self contained test to repeat it. Thanks, Greig -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html From greigwise@comcast.net Tue Sep 25 18:34:19 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4sAM-00066v-VJ for pgsql-general@arkaria.postgresql.org; Tue, 25 Sep 2018 18:34:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g4sAK-00053X-3g for pgsql-general@arkaria.postgresql.org; Tue, 25 Sep 2018 18:34:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4sAJ-00053M-Rh for pgsql-general@lists.postgresql.org; Tue, 25 Sep 2018 18:34:31 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g4sAA-0001ji-Fj for pgsql-general@postgresql.org; Tue, 25 Sep 2018 18:34:31 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 94572F5A9FB9 for ; Tue, 25 Sep 2018 11:34:19 -0700 (MST) Date: Tue, 25 Sep 2018 11:34:19 -0700 (MST) From: greigwise To: pgsql-general@postgresql.org Message-ID: <1537900459605-0.post@n3.nabble.com> In-Reply-To: <1537536021272-0.post@n3.nabble.com> References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> <1537536021272-0.post@n3.nabble.com> Subject: Re: Out of Memory MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Well, I've been unsuccessful so far on creating a standalone test. I have put some scripting in place to capture some additional information on the server with the out of memory issues. I have a script which just periodically dumps the output of free -m to a text file. So, the output of free -m immediately before and after the out of memory error looks like this: Just before: total used free shared buff/cache available Mem: 14877 2978 132 3553 11766 7943 Swap: 0 0 0 Just after: total used free shared buff/cache available Mem: 14877 2946 649 3548 11280 7982 Swap: 0 0 0 If I have nearly 8 GB of memory left, why am I getting out of memory errors? Thanks, Greig -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html From tgl@sss.pgh.pa.us Tue Sep 25 20:13:04 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4thu-0004Xe-Ri for pgsql-general@arkaria.postgresql.org; Tue, 25 Sep 2018 20:13:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g4tht-0006J4-2Z for pgsql-general@arkaria.postgresql.org; Tue, 25 Sep 2018 20:13:17 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4ths-0006Ix-NX for pgsql-general@lists.postgresql.org; Tue, 25 Sep 2018 20:13:16 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4thm-0003F7-6P for pgsql-general@postgresql.org; Tue, 25 Sep 2018 20:13:15 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8PKD4BN018742; Tue, 25 Sep 2018 16:13:04 -0400 From: Tom Lane To: greigwise cc: pgsql-general@postgresql.org Subject: Re: Out of Memory In-reply-to: <1537900459605-0.post@n3.nabble.com> References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> Comments: In-reply-to greigwise message dated "Tue, 25 Sep 2018 11:34:19 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18740.1537906384.1@sss.pgh.pa.us> Date: Tue, 25 Sep 2018 16:13:04 -0400 Message-ID: <18741.1537906384@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk greigwise writes: > If I have nearly 8 GB of memory left, why am I getting out of memory errors? Probably the postmaster is running under restrictive ulimit settings. regards, tom lane From greigwise@comcast.net Tue Sep 25 21:02:59 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4uUG-0007Zo-9o for pgsql-general@arkaria.postgresql.org; Tue, 25 Sep 2018 21:03:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g4uUB-0005Wi-Ex for pgsql-general@arkaria.postgresql.org; Tue, 25 Sep 2018 21:03:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4uUB-0005Wb-6e for pgsql-general@lists.postgresql.org; Tue, 25 Sep 2018 21:03:11 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g4uU1-0005w3-PA for pgsql-general@postgresql.org; Tue, 25 Sep 2018 21:03:10 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id B5005F5B2260 for ; Tue, 25 Sep 2018 14:02:59 -0700 (MST) Date: Tue, 25 Sep 2018 14:02:59 -0700 (MST) From: greigwise To: pgsql-general@postgresql.org Message-ID: <1537909379739-0.post@n3.nabble.com> In-Reply-To: <18741.1537906384@sss.pgh.pa.us> References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> Subject: Re: Out of Memory MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane-2 wrote > greigwise < > greigwise@ > > writes: >> If I have nearly 8 GB of memory left, why am I getting out of memory >> errors? > > Probably the postmaster is running under restrictive ulimit settings. > > regards, tom lane If I login as the user which runs postmaster, I get this: -bash-4.2$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 59341 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 4096 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited Max memory size is unlimited as is virtual memory... is there something else there I should be concerned with in regard to out of memory? Thanks again. Greig -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html From wmoran@potentialtech.com Tue Sep 25 21:04:49 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4uVs-0007c2-UM for pgsql-general@arkaria.postgresql.org; Tue, 25 Sep 2018 21:04:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g4uVq-0008FQ-ED for pgsql-general@arkaria.postgresql.org; Tue, 25 Sep 2018 21:04:54 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4uVq-0008FJ-2i for pgsql-general@lists.postgresql.org; Tue, 25 Sep 2018 21:04:54 +0000 Received: from virtual1.potentialtech.com ([69.25.178.43] helo=mail.potentialtech.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4uVn-0004tG-M5 for pgsql-general@postgresql.org; Tue, 25 Sep 2018 21:04:52 +0000 Received: from beezelbub (c-67-171-70-156.hsd1.pa.comcast.net [67.171.70.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.potentialtech.com (Postfix) with ESMTPSA id 77BD724BEBB; Tue, 25 Sep 2018 17:04:50 -0400 (EDT) Date: Tue, 25 Sep 2018 17:04:49 -0400 From: PT To: greigwise Cc: pgsql-general@postgresql.org Subject: Re: Out of Memory Message-Id: <20180925170449.0afefaf0a352439cd10d3588@potentialtech.com> In-Reply-To: <1537900459605-0.post@n3.nabble.com> References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 25 Sep 2018 11:34:19 -0700 (MST) greigwise wrote: > Well, I've been unsuccessful so far on creating a standalone test. > > I have put some scripting in place to capture some additional information on > the server with the out of memory issues. I have a script which just > periodically dumps the output of free -m to a text file. > > So, the output of free -m immediately before and after the out of memory > error looks like this: > > Just before: > total used free shared buff/cache > available > Mem: 14877 2978 132 3553 11766 > 7943 > Swap: 0 0 0 > > Just after: > total used free shared buff/cache > available > Mem: 14877 2946 649 3548 11280 > 7982 > Swap: 0 0 0 > > If I have nearly 8 GB of memory left, why am I getting out of memory errors? Doesn't the default NUMA setup mean that it can't actually allocate all the available memory to a single NUMA zone (or whatever it's called)? Or am I talking ancient Linux history with that? -- Bill Moran From tmblue@gmail.com Tue Sep 25 21:12:00 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4ud0-0007xZ-Bc for pgsql-general@arkaria.postgresql.org; Tue, 25 Sep 2018 21:12:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g4ucy-0002m8-Jc for pgsql-general@arkaria.postgresql.org; Tue, 25 Sep 2018 21:12:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4ucy-0002ly-3t for pgsql-general@lists.postgresql.org; Tue, 25 Sep 2018 21:12:16 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g4ucv-00055C-3z for pgsql-general@postgresql.org; Tue, 25 Sep 2018 21:12:14 +0000 Received: by mail-lj1-x231.google.com with SMTP id v9-v6so23156957ljk.4 for ; Tue, 25 Sep 2018 14:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uJCPRTVLrM58wPw5z0sy4H2Gji5ArPzHCMnGzL5BJiY=; b=Da4Cm0C++6sf+8bXooWVzI2BeWAcuHpV6jGY7HTpPdr9vqjtZDYwsS8xA9m44UiNQ8 8DGdA/RircMXcyRwLw1Jza7VUbioEp0OODTJFIQpc2f2COnKPeasEQynHyfn6XLLtuYH A3nPfof/Mi42wmMFC1aA7atJoM8hOOH8pdQ5fg7omT1aal82o5ty2Fv6+6Fc4bJ9FAAY fsg5pCZIFfkEz4EFT2oOWk4w4cXrfLwAB5xRExSLbyEfn1FsIs/OA6MdAqN4tsibF85R f97G2XkpzjDCXUjDTp2JVRNhZzJPGGMhjEI0R9oRmAhmC9AiSaZc/+k8WKqafSePVSpL RnFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uJCPRTVLrM58wPw5z0sy4H2Gji5ArPzHCMnGzL5BJiY=; b=RecYV6JyEh/PcIVnmVgM0qDKu9vol1tLmq9N29qQKXSaISaFnVU6kBNdVJoT5jyBBG Hqlt0YQMTtbgGJueyaKQojTrsnw0mPfigxPxrafvfZNXeqVKc/xNJSBr/oyqzE8+ixfB X0Wkve/+6EiqJ0IQDWDXEecyhSTcYIQHErQvqYSWaBEDNum1omTL61506Rkp/D8x7WKa TB7yyFtVt8heM2VrdIhj2jYH3KJljjKiGYOL+2biAwvapyHCfIgI/4DjE4A21B1kkKlK HkbuxwL2plkU8lySOGB4AlrxEO++VqRMAaLPIvXa40nfp2L9+Yzzz+llxrLLfSarr3qJ YhGQ== X-Gm-Message-State: ABuFfoiiAYUt1rs+gly9D8G6nvyb1Sbk3bpbCkO7kp1dKjUSebrOsmzH 00Dmz0akSa4QI6U2rky29kEWs6HTRNMOa0v19UI= X-Google-Smtp-Source: ACcGV635IvIsIuPt0uD1juR0TWql6CEAaKUTMv0eLj4Mf5EqxU4kcoHfZqz8B84vls8YyE7e5YQNzHWeeR4rTv1QjwA= X-Received: by 2002:a2e:990a:: with SMTP id v10-v6mr2165997lji.22.1537909931095; Tue, 25 Sep 2018 14:12:11 -0700 (PDT) MIME-Version: 1.0 References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <20180925170449.0afefaf0a352439cd10d3588@potentialtech.com> In-Reply-To: <20180925170449.0afefaf0a352439cd10d3588@potentialtech.com> From: Tory M Blue Date: Tue, 25 Sep 2018 14:12:00 -0700 Message-ID: Subject: Re: Out of Memory To: wmoran@potentialtech.com Cc: greigwise@comcast.net, PG-General Mailing List Content-Type: multipart/alternative; boundary="00000000000023bb280576b88f1e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000023bb280576b88f1e Content-Type: text/plain; charset="UTF-8" On Tue, Sep 25, 2018 at 2:05 PM PT wrote: > On Tue, 25 Sep 2018 11:34:19 -0700 (MST) > greigwise wrote: > > > Well, I've been unsuccessful so far on creating a standalone test. > > > > I have put some scripting in place to capture some additional > information on > > the server with the out of memory issues. I have a script which just > > periodically dumps the output of free -m to a text file. > > > > So, the output of free -m immediately before and after the out of memory > > error looks like this: > > > > Just before: > > total used free shared buff/cache > > available > > Mem: 14877 2978 132 3553 11766 > > > 7943 > > Swap: 0 0 0 > > > > Just after: > > total used free shared buff/cache > > available > > Mem: 14877 2946 649 3548 11280 > > > 7982 > > Swap: 0 0 0 > > > > If I have nearly 8 GB of memory left, why am I getting out of memory > errors? > > Doesn't the default NUMA setup mean that it can't actually allocate all > the available memory to a single NUMA zone (or whatever it's called)? > > Or am I talking ancient Linux history with that? > > -- > Bill Moran > > By the way we have similar issues running in our smaller stage environment. 9.5.6 on CentOS 7.2 Only ever my stage environment on smaller AWS t2 boxen. Memory looks fine but Postgres says it has no access to any. And my settings are really low. Not sure if it's the same issue, but we run into it a few times a year in my stage environment. Also running postgres in unlimited mode for ulimit. Tory --00000000000023bb280576b88f1e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue= , Sep 25, 2018 at 2:05 PM PT <wmoran@potentialtech.com> wrote:
On Tue, 25 Sep 2018 11:34:19 -0700 (MST)
greigwise <gr= eigwise@comcast.net> wrote:

> Well, I've been unsuccessful so far on creating a standalone test.= =C2=A0 =C2=A0
>
> I have put some scripting in place to capture some additional informat= ion on
> the server with the out of memory issues.=C2=A0 =C2=A0I have a script = which just
> periodically dumps the output of free -m to a text file.=C2=A0
>
> So, the output of free -m immediately before and after the out of memo= ry
> error looks like this:
>
> Just before:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0total=C2=A0 =C2= =A0 =C2=A0 =C2=A0 used=C2=A0 =C2=A0 =C2=A0 =C2=A0 free=C2=A0 =C2=A0 =C2=A0 = shared=C2=A0 buff/cache=C2=A0
> available
> Mem:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 14877=C2=A0 =C2=A0 =C2=A0 =C2= =A0 2978=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0132=C2=A0 =C2=A0 =C2=A0 =C2=A0 35= 53=C2=A0 =C2=A0 =C2=A0 =C2=A011766=C2=A0 =C2=A0 =C2=A0 =C2=A0
> 7943
> Swap:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A00=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00
>
> Just after:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0total=C2=A0 =C2= =A0 =C2=A0 =C2=A0 used=C2=A0 =C2=A0 =C2=A0 =C2=A0 free=C2=A0 =C2=A0 =C2=A0 = shared=C2=A0 buff/cache=C2=A0
> available
> Mem:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 14877=C2=A0 =C2=A0 =C2=A0 =C2= =A0 2946=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0649=C2=A0 =C2=A0 =C2=A0 =C2=A0 35= 48=C2=A0 =C2=A0 =C2=A0 =C2=A011280=C2=A0 =C2=A0 =C2=A0 =C2=A0
> 7982
> Swap:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A00=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00
>
> If I have nearly 8 GB of memory left, why am I getting out of memory e= rrors?

Doesn't the default NUMA setup mean that it can't actually allocate= all
the available memory to a single NUMA zone (or whatever it's called)?
Or am I talking ancient Linux history with that?

--
Bill Moran

=C2=A0
By the way we have similar issues ru= nning in our smaller stage environment.=C2=A0=C2=A09.5.6 on CentOS 7.2

Only ever my = stage environment on smaller AWS t2 boxen. Memory looks fine but Postgres s= ays it has no access to any. And my settings are really low.

Not sure if it's the same issue, but we run into it a= few times a year in my stage environment. Also running postgres in unlimit= ed mode for ulimit.

=
Tory
--00000000000023bb280576b88f1e-- From greigwise@comcast.net Wed Sep 26 14:24:41 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5AkG-0002H3-6i for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 14:24:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5AkE-0000md-0p for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 14:24:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5AkD-0000mV-P8 for pgsql-general@lists.postgresql.org; Wed, 26 Sep 2018 14:24:49 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5Ak8-0003it-Gl for pgsql-general@postgresql.org; Wed, 26 Sep 2018 14:24:49 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 8F68DF5EB158 for ; Wed, 26 Sep 2018 07:24:41 -0700 (MST) Date: Wed, 26 Sep 2018 07:24:41 -0700 (MST) From: greigwise To: pgsql-general@postgresql.org Message-ID: <1537971881585-0.post@n3.nabble.com> In-Reply-To: <1537909379739-0.post@n3.nabble.com> References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> <1537909379739-0.post@n3.nabble.com> Subject: Re: Out of Memory MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk There is also this: -bash-4.2$ prlimit -p 6590 RESOURCE DESCRIPTION SOFT HARD UNITS AS address space limit unlimited unlimited bytes CORE max core file size 0 unlimited blocks CPU CPU time unlimited unlimited seconds DATA max data size unlimited unlimited bytes FSIZE max file size unlimited unlimited blocks LOCKS max number of file locks held unlimited unlimited MEMLOCK max locked-in-memory address space 65536 65536 bytes MSGQUEUE max bytes in POSIX mqueues 819200 819200 bytes NICE max nice prio allowed to raise 0 0 NOFILE max number of open files 1024 4096 NPROC max number of processes 4096 59341 RSS max resident set size unlimited unlimited pages RTPRIO max real-time priority 0 0 RTTIME timeout for real-time tasks unlimited unlimited microsecs SIGPENDING max number of pending signals 59341 59341 STACK max stack size 8388608 unlimited bytes Is it possible that the fact that my stack size is limited is what is causing my issue? Thanks, Greig -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html From tgl@sss.pgh.pa.us Wed Sep 26 14:37:08 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5AxL-00032f-6f for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 14:38:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5AxJ-0001kH-An for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 14:38:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5Awg-0007A0-Hs for pgsql-general@lists.postgresql.org; Wed, 26 Sep 2018 14:37:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5Awd-00042d-C7 for pgsql-general@postgresql.org; Wed, 26 Sep 2018 14:37:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8QEb8hl003322; Wed, 26 Sep 2018 10:37:08 -0400 From: Tom Lane To: greigwise cc: pgsql-general@postgresql.org Subject: Re: Out of Memory In-reply-to: <1537971881585-0.post@n3.nabble.com> References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> <1537909379739-0.post@n3.nabble.com> <1537971881585-0.post@n3.nabble.com> Comments: In-reply-to greigwise message dated "Wed, 26 Sep 2018 07:24:41 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3320.1537972628.1@sss.pgh.pa.us> Date: Wed, 26 Sep 2018 10:37:08 -0400 Message-ID: <3321.1537972628@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk greigwise writes: > Is it possible that the fact that my stack size is limited is what is > causing my issue? No. If you were hitting that limit you'd get a message specifically talking about stack. regards, tom lane From greigwise@comcast.net Wed Sep 26 14:49:17 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5B80-0003gR-OU for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 14:49:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5B7y-0007LB-MF for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 14:49:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5B7y-0007L4-A7 for pgsql-general@lists.postgresql.org; Wed, 26 Sep 2018 14:49:22 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5B7u-0002xR-Tp for pgsql-general@postgresql.org; Wed, 26 Sep 2018 14:49:21 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 02E8EF5EC917 for ; Wed, 26 Sep 2018 07:49:18 -0700 (MST) Date: Wed, 26 Sep 2018 07:49:17 -0700 (MST) From: greigwise To: pgsql-general@postgresql.org Message-ID: <1537973357976-0.post@n3.nabble.com> In-Reply-To: <3321.1537972628@sss.pgh.pa.us> References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> <1537909379739-0.post@n3.nabble.com> <1537971881585-0.post@n3.nabble.com> <3321.1537972628@sss.pgh.pa.us> Subject: Re: Out of Memory MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane-2 wrote > greigwise < > greigwise@ > > writes: >> Is it possible that the fact that my stack size is limited is what is >> causing my issue? > > No. If you were hitting that limit you'd get a message specifically > talking about stack. > > regards, tom lane Well, darn. I'm at a loss... any suggestions of what I should do next to troubleshoot this? Thanks. Greig -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html From greigwise@comcast.net Wed Sep 26 16:24:28 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5CcB-0008VE-B7 for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 16:24:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5Cc8-0002O0-IR for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 16:24:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5Cc8-0002NL-A8 for pgsql-general@lists.postgresql.org; Wed, 26 Sep 2018 16:24:36 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5Cc2-0006hW-Hm for pgsql-general@postgresql.org; Wed, 26 Sep 2018 16:24:33 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 6D07FF5F1B03 for ; Wed, 26 Sep 2018 09:24:28 -0700 (MST) Date: Wed, 26 Sep 2018 09:24:28 -0700 (MST) From: greigwise To: pgsql-general@postgresql.org Message-ID: <1537979068444-0.post@n3.nabble.com> In-Reply-To: <1537973357976-0.post@n3.nabble.com> References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> <1537909379739-0.post@n3.nabble.com> <1537971881585-0.post@n3.nabble.com> <3321.1537972628@sss.pgh.pa.us> <1537973357976-0.post@n3.nabble.com> Subject: Re: Out of Memory MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I think I figured it out: vm.overcommit_memory = 2 vm.overcommit_ratio = 50 Only allows me to use 50% of my RAM... ugh! I have 16 GB, so when only 8 is left, I start seeing OOM. Will increase this setting and see if it helps. Thanks everyone for the help. Greig -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html From greigwise@comcast.net Wed Sep 26 16:32:49 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5CkE-0000Zp-EN for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 16:32:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5CkC-0005b9-Rt for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 16:32:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5CkC-0005b2-Jk for pgsql-general@lists.postgresql.org; Wed, 26 Sep 2018 16:32:56 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5Ck7-0006vE-AU for pgsql-general@postgresql.org; Wed, 26 Sep 2018 16:32:55 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id E14F5F5F2347 for ; Wed, 26 Sep 2018 09:32:49 -0700 (MST) Date: Wed, 26 Sep 2018 09:32:49 -0700 (MST) From: greigwise To: pgsql-general@postgresql.org Message-ID: <1537979569920-0.post@n3.nabble.com> In-Reply-To: <1537979068444-0.post@n3.nabble.com> References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> <1537909379739-0.post@n3.nabble.com> <1537971881585-0.post@n3.nabble.com> <3321.1537972628@sss.pgh.pa.us> <1537973357976-0.post@n3.nabble.com> <1537979068444-0.post@n3.nabble.com> Subject: Re: Out of Memory MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk All right.. one more thing here. Any suggestions for how to set overcommit on a postgres db server with 16 GB of RAM and no swap? I think I want vm.overcommit_memory = 2, as I understand that prevents the OOM killer from zapping me. Is 100% the right way to go for overcommit_ratio? Is there a drawback to this? Thanks again. Greig -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html From laurenz.albe@cybertec.at Wed Sep 26 18:05:56 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5ECT-00057u-4M for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 18:06:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5ECR-0006e6-F8 for pgsql-general@arkaria.postgresql.org; Wed, 26 Sep 2018 18:06:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5ECR-0006dz-32 for pgsql-general@lists.postgresql.org; Wed, 26 Sep 2018 18:06:11 +0000 Received: from mx1.mailbox.org ([2001:67c:2050:104:0:1:25:1]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5ECN-0007RV-Rt for pgsql-general@postgresql.org; Wed, 26 Sep 2018 18:06:09 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 3E36649916; Wed, 26 Sep 2018 20:06:01 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id 6wWkFyuQHof5; Wed, 26 Sep 2018 20:05:58 +0200 (CEST) Message-ID: <824208787ca76bb05c1076b72629e394c6ed660b.camel@cybertec.at> Subject: Re: Out of Memory From: Laurenz Albe To: greigwise , pgsql-general@postgresql.org Date: Wed, 26 Sep 2018 20:05:56 +0200 In-Reply-To: <1537979569920-0.post@n3.nabble.com> References: <1537481492525-0.post@n3.nabble.com> <16504.1537483871@sss.pgh.pa.us> <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> <1537909379739-0.post@n3.nabble.com> <1537971881585-0.post@n3.nabble.com> <3321.1537972628@sss.pgh.pa.us> <1537973357976-0.post@n3.nabble.com> <1537979068444-0.post@n3.nabble.com> <1537979569920-0.post@n3.nabble.com> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk greigwise wrote: > All right.. one more thing here. Any suggestions for how to set overcommit > on a postgres db server with 16 GB of RAM and no swap? I think I want > vm.overcommit_memory = 2, as I understand that prevents the OOM killer from > zapping me. Is 100% the right way to go for overcommit_ratio? Is there a > drawback to this? vm.overcommit_memory = 2 vm_overcommit_ratio = 100 Linux commits (swap * overcommit_ratio * RAM / 100), so without any swap the correct value would be 100. I don't know how safe it is to got entirely without swap. I would add a little bit just to be sure. Yours, Laurenz Albe From cmt@burggraben.net Thu Sep 27 06:30:39 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5PpH-0005CQ-Df for pgsql-general@arkaria.postgresql.org; Thu, 27 Sep 2018 06:31:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5PpE-00019n-Bz for pgsql-general@arkaria.postgresql.org; Thu, 27 Sep 2018 06:31:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5PpD-00019g-SZ for pgsql-general@lists.postgresql.org; Thu, 27 Sep 2018 06:31:00 +0000 Received: from smtp.burggraben.net ([2a01:4f8:140:50a2::3:1]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5Pp9-0007bS-4a for pgsql-general@lists.postgresql.org; Thu, 27 Sep 2018 06:30:58 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp.burggraben.net (Postfix) with ESMTP id C9E466002F6 for ; Thu, 27 Sep 2018 08:30:50 +0200 (CEST) X-Spam-Scanned: by amavisd-new at exwg.net Received: from smtp.burggraben.net ([127.0.0.1]) by localhost (ns.burggraben.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z3YXq1uAXesz for ; Thu, 27 Sep 2018 08:30:40 +0200 (CEST) Received: from squirrel.exwg.net (p5B2D8A4F.dip0.t-ipconnect.de [91.45.138.79]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "squirrel.exwg.net", Issuer "Christoph Moench-Tegeder" (verified OK)) by smtp.burggraben.net (Postfix) with ESMTPS for ; Thu, 27 Sep 2018 08:30:40 +0200 (CEST) Received: by squirrel.exwg.net (Postfix, from userid 1000) id 76D50E0826D; Thu, 27 Sep 2018 08:30:39 +0200 (CEST) Date: Thu, 27 Sep 2018 08:30:39 +0200 From: Christoph Moench-Tegeder To: pgsql-general@lists.postgresql.org Subject: Re: Out of Memory Message-ID: <20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net> References: <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> <1537909379739-0.post@n3.nabble.com> <1537971881585-0.post@n3.nabble.com> <3321.1537972628@sss.pgh.pa.us> <1537973357976-0.post@n3.nabble.com> <1537979068444-0.post@n3.nabble.com> <1537979569920-0.post@n3.nabble.com> <824208787ca76bb05c1076b72629e394c6ed660b.camel@cybertec.at> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <824208787ca76bb05c1076b72629e394c6ed660b.camel@cybertec.at> User-Agent: NeoMutt/20170113 (1.7.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ## Laurenz Albe (laurenz.albe@cybertec.at): > vm.overcommit_memory = 2 > vm_overcommit_ratio = 100 > > Linux commits (swap * overcommit_ratio * RAM / 100), ^ That should be a "+". See Documentation/sysctl/vm.txt and Documentation/vm/overcommit-accounting.rst in your kernel tree. > so without any swap the correct value would be 100. > > I don't know how safe it is to got entirely without swap. That's completely safe. Even more: if your production machine ever needs swap, it's already mostly dead in the water. So there's also no benefit in having the kernel copy stuff to swap "just in case" (read: set sysctl vm.swappiness to 0) and use the swap disk space for something more productive. If your memory usage ever exceeds available memory, something already went horribly wrong, and you want to know about it right now. A good way to know about this kind of mistakes is having stuff fail hard, obviously and loudly (i.e. Out Of Memory). Do not try to save some day by swapping: stuff is "sometimes slow" and if you really need the swap, everything crawls to a halt anyway. Of course, this does not hold for personal workstations and the like where you might want to use the swap space for suspend to disk, or have some buffer in case of runaway processes. Regards, Christoph -- Spare Space. From laurenz.albe@cybertec.at Thu Sep 27 21:45:42 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5e6b-00088r-DK for pgsql-general@arkaria.postgresql.org; Thu, 27 Sep 2018 21:45:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5e6Z-0005tB-Nv for pgsql-general@arkaria.postgresql.org; Thu, 27 Sep 2018 21:45:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5e6Z-0005t4-FS for pgsql-general@lists.postgresql.org; Thu, 27 Sep 2018 21:45:51 +0000 Received: from mx1.mailbox.org ([2001:67c:2050:104:0:1:25:1]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5e6W-0000zB-T5 for pgsql-general@lists.postgresql.org; Thu, 27 Sep 2018 21:45:50 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 3B4CB49100; Thu, 27 Sep 2018 23:45:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id eB9rwgxBIzAx; Thu, 27 Sep 2018 23:45:43 +0200 (CEST) Message-ID: <3973cda30071755051a8b63a1aa64727a5a79998.camel@cybertec.at> Subject: Re: Out of Memory From: Laurenz Albe To: Christoph Moench-Tegeder , pgsql-general@lists.postgresql.org Date: Thu, 27 Sep 2018 23:45:42 +0200 In-Reply-To: <20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net> References: <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> <1537909379739-0.post@n3.nabble.com> <1537971881585-0.post@n3.nabble.com> <3321.1537972628@sss.pgh.pa.us> <1537973357976-0.post@n3.nabble.com> <1537979068444-0.post@n3.nabble.com> <1537979569920-0.post@n3.nabble.com> <824208787ca76bb05c1076b72629e394c6ed660b.camel@cybertec.at> <20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Christoph Moench-Tegeder wrote: > ## Laurenz Albe (laurenz.albe@cybertec.at): > > > vm.overcommit_memory = 2 > > vm_overcommit_ratio = 100 > > > > Linux commits (swap * overcommit_ratio * RAM / 100), > > ^ > That should be a "+". Yes; shame on me for careless typing, and thank you for the correction. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com From robjsargent@gmail.com Fri Sep 28 00:05:20 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5gHl-0005gr-PV for pgsql-general@arkaria.postgresql.org; Fri, 28 Sep 2018 00:05:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5gHj-0007Jp-LR for pgsql-general@arkaria.postgresql.org; Fri, 28 Sep 2018 00:05:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5gHj-0007Jh-8E for pgsql-general@lists.postgresql.org; Fri, 28 Sep 2018 00:05:31 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5gHc-0005Xm-BM for pgsql-general@lists.postgresql.org; Fri, 28 Sep 2018 00:05:29 +0000 Received: by mail-pg1-x52c.google.com with SMTP id b129-v6so3051277pga.13 for ; Thu, 27 Sep 2018 17:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nGu8F8CPRHx5aqAaJikvoWWeMzHUi8FyrFTHYVEJ4Co=; b=ignaRHq78AB5OI+im0zFB3npUmLD3gqTCAu01YQUcYKEKiScqi1XvFqA5Qwuly6edz FoVRUU4hVvg3Em2dD3suXfcYn9nvZ55224O/YGMGJtvIPvBC5GMU8J76imdfa/dZWbfe XKRKxvWZdal3aXMXTiaQzZ1vfi28efplFukPbLiFkCFGNMhjHEDKDIhXx3FWlkzPrLtH 7OBjZG666BosGuMdvkkTkXTbCkPvG/uSzBl7RDjwWk7fISY82KQnTD5lrkrKQojg/c4/ b8ZIFMOJqDJaQot5u5ZIM+EoNnUQd5stiMndEioF4dLbGfYFkdV2V5CJ0rFtJk0NHhbA Oqlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nGu8F8CPRHx5aqAaJikvoWWeMzHUi8FyrFTHYVEJ4Co=; b=MztkE5uNB+kuCk/eoW6oo1X/C66D6up5ysUinKvF+65KkcCtS50ct2vmWua0DytheW JjEsYDwKiI19s01PGJVTiYmgMx6F0z6wGN2gtappPD8ScuTRQFOkz9HU8UL2EPM2mdL+ A4uTOw5mn9CrW+WJmh+2ZFFVeEDwxd5NUQwhcR8lMFb4E2YkPEAQYkG4vHcfM5yYcfBz vt4DYsvy9LKfUZI7rn3EIt1z1SQAJWO0dymoxvomj1Dk6IryxKbmWf+pSaVxytSzBcyA Gd5qSoeUjbYxHKl1GwFzCQQn0WWfTXcHXnLpY7aa3BySXDbHvdKCcOpCOc1MBt+3YxmN iv3A== X-Gm-Message-State: ABuFfojsMkAp8yNSAxVHRz47A5PbQ1JXAMJrDtJOwInbxkA0tJyv5frC 5Y8VtyfzG49DnxOs+1Zk529OF8j8 X-Google-Smtp-Source: ACcGV61LupkT1dkD11+gs3+gKIFqyCjzSzcjPh9+16NprYnXt5fWMunaEITD1Nzvjam3qJ+zENGqKQ== X-Received: by 2002:a17:902:15c5:: with SMTP id a5-v6mr13362622plh.137.1538093122472; Thu, 27 Sep 2018 17:05:22 -0700 (PDT) Received: from kitselas.hci.utah.edu ([155.100.47.7]) by smtp.gmail.com with ESMTPSA id h12-v6sm4678022pfo.135.2018.09.27.17.05.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 17:05:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: Out of Memory From: Rob Sargent In-Reply-To: <3973cda30071755051a8b63a1aa64727a5a79998.camel@cybertec.at> Date: Thu, 27 Sep 2018 18:05:20 -0600 Cc: Christoph Moench-Tegeder , pgsql-general@lists.postgresql.org Content-Transfer-Encoding: 7bit Message-Id: <704B7535-D731-47EA-9E1E-2055B42CAD7B@gmail.com> References: <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> <1537909379739-0.post@n3.nabble.com> <1537971881585-0.post@n3.nabble.com> <3321.1537972628@sss.pgh.pa.us> <1537973357976-0.post@n3.nabble.com> <1537979068444-0.post@n3.nabble.com> <1537979569920-0.post@n3.nabble.com> <824208787ca76bb05c1076b72629e394c6ed660b.camel@cybertec.at> <20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net> <3973cda30071755051a8b63a1aa64727a5a79998.camel@cybertec.at> To: Laurenz Albe X-Mailer: Apple Mail (2.3445.9.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Sep 27, 2018, at 3:45 PM, Laurenz Albe wrote: > > Christoph Moench-Tegeder wrote: >> ## Laurenz Albe (laurenz.albe@cybertec.at): >> >>> vm.overcommit_memory = 2 >>> vm_overcommit_ratio = 100 >>> >>> Linux commits (swap * overcommit_ratio * RAM / 100), >> >> ^ >> That should be a "+". > > Yes; shame on me for careless typing, and thank you for the > correction. Are there any parentheses needed in that formula? From laurenz.albe@cybertec.at Fri Sep 28 05:23:59 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5lG7-0001Ld-H6 for pgsql-general@arkaria.postgresql.org; Fri, 28 Sep 2018 05:24:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5lG5-0005zm-RP for pgsql-general@arkaria.postgresql.org; Fri, 28 Sep 2018 05:24:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5lG5-0005zf-GE for pgsql-general@lists.postgresql.org; Fri, 28 Sep 2018 05:24:09 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5lG2-0004GP-6s for pgsql-general@lists.postgresql.org; Fri, 28 Sep 2018 05:24:08 +0000 Received: from smtp2.mailbox.org (unknown [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 354F349278; Fri, 28 Sep 2018 07:24:02 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id CuIW8ECTnHkW; Fri, 28 Sep 2018 07:24:00 +0200 (CEST) Message-ID: Subject: Re: Out of Memory From: Laurenz Albe To: Rob Sargent Cc: Christoph Moench-Tegeder , pgsql-general@lists.postgresql.org Date: Fri, 28 Sep 2018 07:23:59 +0200 In-Reply-To: <704B7535-D731-47EA-9E1E-2055B42CAD7B@gmail.com> References: <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> <1537909379739-0.post@n3.nabble.com> <1537971881585-0.post@n3.nabble.com> <3321.1537972628@sss.pgh.pa.us> <1537973357976-0.post@n3.nabble.com> <1537979068444-0.post@n3.nabble.com> <1537979569920-0.post@n3.nabble.com> <824208787ca76bb05c1076b72629e394c6ed660b.camel@cybertec.at> <20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net> <3973cda30071755051a8b63a1aa64727a5a79998.camel@cybertec.at> <704B7535-D731-47EA-9E1E-2055B42CAD7B@gmail.com> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Rob Sargent wrote: > > Christoph Moench-Tegeder wrote: > > > ## Laurenz Albe (laurenz.albe@cybertec.at): > > > > > > > vm.overcommit_memory = 2 > > > > vm_overcommit_ratio = 100 > > > > > > > > Linux commits (swap * overcommit_ratio * RAM / 100), > > > > > > ^ > > > That should be a "+". > > > > Yes; shame on me for careless typing, and thank you for the > > correction. > > Are there any parentheses needed in that formula? No. It is swap space plus a certain percentage of RAM. I don't know how the Linux developers came up with that weird formula. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com From hjp-pgsql@hjp.at Sat Sep 29 10:25:18 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g6CRN-0004L4-DJ for pgsql-general@arkaria.postgresql.org; Sat, 29 Sep 2018 10:25:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g6CRJ-000849-0U for pgsql-general@arkaria.postgresql.org; Sat, 29 Sep 2018 10:25:33 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g6CRI-00083z-KN for pgsql-general@lists.postgresql.org; Sat, 29 Sep 2018 10:25:32 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g6CR7-000172-6h for pgsql-general@lists.postgresql.org; Sat, 29 Sep 2018 10:25:30 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 8DDCF1FF0; Sat, 29 Sep 2018 12:25:18 +0200 (CEST) Date: Sat, 29 Sep 2018 12:25:18 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Out of Memory Message-ID: <20180929102518.rhz5o7wo3ner4zv6@hjp.at> References: <1537971881585-0.post@n3.nabble.com> <3321.1537972628@sss.pgh.pa.us> <1537973357976-0.post@n3.nabble.com> <1537979068444-0.post@n3.nabble.com> <1537979569920-0.post@n3.nabble.com> <824208787ca76bb05c1076b72629e394c6ed660b.camel@cybertec.at> <20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net> <3973cda30071755051a8b63a1aa64727a5a79998.camel@cybertec.at> <704B7535-D731-47EA-9E1E-2055B42CAD7B@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="m4y6tpd7neenbcxx" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --m4y6tpd7neenbcxx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-09-28 07:23:59 +0200, Laurenz Albe wrote: > Rob Sargent wrote: > > > Christoph Moench-Tegeder wrote: > > > > ## Laurenz Albe (laurenz.albe@cybertec.at): > > > >=20 > > > > > vm.overcommit_memory =3D 2 > > > > > vm_overcommit_ratio =3D 100 > > > > >=20 > > > > > Linux commits (swap * overcommit_ratio * RAM / 100), > > > >=20 > > > > ^ > > > > That should be a "+". > > >=20 > > > Yes; shame on me for careless typing, and thank you for the > > > correction. > >=20 > > Are there any parentheses needed in that formula? >=20 > No. It is swap space plus a certain percentage of RAM. >=20 > I don't know how the Linux developers came up with that > weird formula. I suspect they copied it from some other Unix. Traditionally, Unix allocated all memory in the swap space. You could say that the swap space was the "real memory" and RAM was a cache for that (Hence the rule that swap must be at least as large as RAM and should preferrably be 2 or 4 times the size of RAM). So, when Unixes started to allow allocating more virtual memory than swap space, they were "overcommitting".=20 But for Linux that doesn't make much sense, since a page lived either in RAM /or/ in swap right from the start, so the limit was always RAM+swap, not swap alone, and you are only overcommitting if you exceeded the size of the sum. The overcommitment in Linux is of a different kind: Linux uses copy on write whereever it can (e.g. when forking processes, but also when mallocing memory), and a CoW page may or may not be written in the future. It only needs additional space when it's actually written, so by counting the page only once (hoping that there will be enough space if and when that page is written) the kernel is overcommitting memory.=20 hp --=20 _ | Peter J. Holzer | we build much bigger, better disasters now |_|_) | | because we have much more sophisticated | | | hjp@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson --m4y6tpd7neenbcxx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAluvUwgACgkQ8g5IURL+ KF1lkg/+M7Tr28y/onqbd2cJux+4RKYaYbiAzfj883tx9rW2eWENevdXyv7wD/+r L8Kgu5rG+c99kp8FvTdKnTu+xlRgMskf9Jczo74n/0gNKASUHu0/FrYdkRo1Jtew m0S0EjneV+9iI2jn1h7v4shoM+TvcDTbfnKN9Z5iOlgPvFypyIQruSCd7j5eeFqv qUN3D+4V+RLyN0qrhp6Ra2T1a8YtC3JQx6vmhBq+49UnbG7GVRyn0utQCVQIZl3S YKOdlsocyzc3j1zQAWZ2PiVgMFoLOyDhnItMoEkKDYvOr4PdV0k48XZ67O+tGAib m1uoJcZFmOHgh4U/vqLLxZHhbcUyA3CF3pm4w+geL8wND/Gj88aGDJSJzBeIAcbC 5imywKhJ78e+jVDf2dsx7rBXMtd6vZ8Zmu8r/nIPx5b60oY5vQYdPhcxBAMtmead j5csHGKkmTmS5zhYYcJs7VTOicSK8bvwMMGc1QRccjcmsHAOb0b/kEi+s7bsglGE bBFrDCuErerZrj5dmP0726lWzcXxmSL4UFyGwfaCTAi4Sbd7VS3/b7VcdQ1O0Bue S1ctxO1121jw5zlJwqZrhIKzxLcWpuys914HUrysFxVjnrH0D23Xef9Da213uqKq A7hrNPMbydlKSwG65Eg1sAz8rITlREGf8Q6rUzrZFiOZaLHrpM8= =vzXz -----END PGP SIGNATURE----- --m4y6tpd7neenbcxx-- From ghoostinger@mail.com Tue Jul 19 13:16:39 2022 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDnY6-0000tG-2F for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 13:46:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDnY4-0002H7-V4 for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 13:46:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDn5h-0007so-FU for pgsql-general@lists.postgresql.org; Tue, 19 Jul 2022 13:16:45 +0000 Received: from mout.gmx.com ([74.208.4.201]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDn5e-0000fx-72 for pgsql-general@postgresql.org; Tue, 19 Jul 2022 13:16:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.com; s=dbd5af2cbaf7; t=1658236599; bh=D6NkY0WH72RDb1ujvVX/Jxv5rL3IlzlkdFh5KHsOBnY=; h=X-UI-Sender-Class:From:To:Subject:Date; b=4CLxDXSX7iPqFCkvUC1JsSwSV25JSlMPo6CwC8YGZTzdI4yENIelszncBo6jxTTLK Ez2UqSX4LpEtzAuvJyYGRpWVBJd5VNYjYfYPSHBwwGqcwGDSy8Not3+09DQ6GzWsun 2c51nxZAFt90o8nG/xE7vcLmd635S/XJEbqRpuUk= X-UI-Sender-Class: 214d933f-fd2f-45c7-a636-f5d79ae31a79 Received: from [41.223.97.88] ([41.223.97.88]) by msvc-mesg-gmxus008.server.lan (via HTTP); Tue, 19 Jul 2022 15:16:39 +0200 MIME-Version: 1.0 Message-ID: From: ghoostinger@mail.com To: pgsql-general@postgresql.org Subject: Out Of Memory Content-Type: text/plain; charset=UTF-8 Date: Tue, 19 Jul 2022 15:16:39 +0200 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:3NXXJwukmecPAsnzPbn9Z8NjEGJkStWEJHD3E5DPYBDyuKiDqzCoDN/WGZ7Eao7vaNw8Z Nd83DXI9Uu2uZBFOslTnyb8PDY36VDgJPcshPowtwrW9nx+gc0YhCbGtXAEI0FISCVWgqE2GVJM4 rW5sHacrsws70TEZKaFQ2wi+K3WeOjPg830t5dglgh3vfOjVMobpHQYqf5NvF7urCqnZA4kCQgFh Gv4z5jOr+IQYQEWlZdV2t4SIyts5jbWO8aV9z/NsnIOE7Ia+lk/YHmUEdlZdy5uvQcPHELJqmbqV bC8uH4NN7u6rDkcLo2GfHpr X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:hfp6XZfUMAU=:zvPrgr0vIJuFE0Sm4faUGc AEnmp57sFeg2q/CAaenUMGsIJcm+CFFFlXiSGEjptqi4ktLaSAx0PjGlUiurY/fTky/JNgo9G Av+cR2cNm4vvqBtcSpWW1KOAKex2uHpDmPTzXzjmb/ZevdjkXMqidh8XNkg++UB09hYR9J5YP /Dbg5a2yai/FAJGbmkdjew7OLDvGM8hTr/w1lyAnm5C/5qxa3gOXqDhwJQUHafLZkXukIHsiS DaVQ7stGfeADymH6WV7Xl+ieryaQ6F4tYJH9O9TG1MdG0jQNBeGjRj0f5tcbORHCg+WFz6cYM X3xdDpS/OHGmcKCrpajZx8648FL4+YaUTQxa48fUclPPDmIepv0f/MvPfeaaod6MP/hW9J4nn BFmjJvjWpQUoaR5enoywas61JoBaCC1rPwN/HDBByx24SK+fsY5Fjzx1OW9/3Zhyrvi7TeWyX Iz0FCTra8oQou95ZmeR+Ly6nlrmJHqI9US4twPOKfmpBjG9ByQjIVEyAbbmvBqBYQgG6kqisG C59a1+srW6zsQ09r6wAOwOQL+7UwXLu7LUMr4o1mA2SHnIusbPQpdSYeMX7EzU6cKQ71lcwxK lKjxWwpoX0aO3gmOfktwCYOhrTtMLVIbonw/neTQyxjEFnQz9N0lmHypa5oe2cFqPAhWs+moN N5v7ArAPbOFLb6OMToreOgrmO8bkfmBc3BmkhNuGU3bi4Xj+pv7LgCe6rkB65tFHqmQ7Q4sd8 UVOS0xqIdl1M5tfNtY8lZyDiFK3+THVHy0abBykHTZijpG3b0RF3Sx1diYnl5MvVALzgNvR6K sxSLaM2 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, I=E2=80=99m using Odoo Erp v12 Community and i want migrate to v14 a= nd i have tablea content more 5m rows and after 8hr of execution it sho msg= =E2=80=9Cout of memory=E2=80=9D so i need your help From adrian.klaver@aklaver.com Tue Jul 19 15:00:43 2022 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDoiW-0003Oq-1L for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 15:00:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDoiU-00049s-Tz for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 15:00:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDoiT-00049i-T5 for pgsql-general@lists.postgresql.org; Tue, 19 Jul 2022 15:00:54 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDoiP-0001SZ-UV for pgsql-general@postgresql.org; Tue, 19 Jul 2022 15:00:53 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 96A783200940; Tue, 19 Jul 2022 11:00:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 19 Jul 2022 11:00:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1658242846; x= 1658329246; bh=IKpjmucz5Lf0WQ9Rc7+IojZ7sqghOvUW/0zm1jthdkw=; b=h K1NYl+PA6j+zwTmkwYYTcnctPOeAg0BsDAyhra0A3YbdFJuXb13t2xbQgmMvSveL fjqZI9FyB1FX4T7LOeLsp07fITka+0cTrHKo5vVMdE3BqyQ0Itwt7mb4j2ieg9JY wEtnE2ZEIwSplaI1wCZdbRPtgWOOWKLmHGSy8yVuxStet6Zkgy2w4keAbTovc+uY /cUzGk1Qh4n77huUkrijXO66xeG+T6uXoGq6cM5e/g+70VnFSZh1AZqg4SHQXuBR KAslaciprLgDcUHX684Wtidqlgeia5pFngzazAHJdTBjJk8KXOlI7SdYcM2cqIP9 kX/j+3Xbyxq1INMlnPEdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1658242846; x=1658329246; bh=I Kpjmucz5Lf0WQ9Rc7+IojZ7sqghOvUW/0zm1jthdkw=; b=wIP7uwCDssdXm9vwl oWkVYVCC7HdBWPyq8Hyzl+B7W3JtJK4UUOOOAEcaz58y6gAKF5OfFYZTU5WVW63v 0AFGAofzNiz3vE6xUnAbPE57LySlKmQizBszwcktH+06hb+DqHNHjMHkxcTFLpfm MZrGvYulCrJc/lyGEwDpS+Mj7Xi0DSpGbFj3Cg8f+eF/cvLMr7tjwPJFakMwUhw6 EgTkxDnJ6ZPrpuBuudh2HfHcgNwUdatH50F+j5XOTfOqwk+VBJfRgiB8LWbkrx8l LIk87LwKUUudY1r5myHCwVdMBuXeXZ78vSx5kLEuCI9P0qalsf0qaxbe6+qKnCqG e+hjw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeltddgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepudfgueelge evfffhgeeljeehhfettdegieelgefgheefffefveegjedtueetffdtnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvh gvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Jul 2022 11:00:44 -0400 (EDT) Message-ID: <33d864f0-84c3-90fe-af4e-4d7d09d766f7@aklaver.com> Date: Tue, 19 Jul 2022 08:00:43 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: Out Of Memory Content-Language: en-US To: ghoostinger@mail.com, pgsql-general@postgresql.org References: From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/19/22 06:16, ghoostinger@mail.com wrote: > Hello, I’m using Odoo Erp v12 Community and i want migrate to v14 and i have tablea content more 5m rows and after 8hr of execution it sho msg “out of memory” so i need your help And we need information: 1) Detail how you are doing migration. 2) Are you doing this on the same machine? 3) OS and version. 4) Hardware specifications for machine e.g. memory, disk space, etc. -- Adrian Klaver adrian.klaver@aklaver.com From adrian.klaver@aklaver.com Tue Jul 19 17:51:04 2022 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDrNI-0003zZ-62 for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 17:51:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDrNH-00015t-2S for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 17:51:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDrNG-00014P-O7 for pgsql-general@lists.postgresql.org; Tue, 19 Jul 2022 17:51:10 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDrNE-0005QX-30 for pgsql-general@postgresql.org; Tue, 19 Jul 2022 17:51:09 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 7A0A13200313; Tue, 19 Jul 2022 13:51:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 19 Jul 2022 13:51:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1658253066; x= 1658339466; bh=x3cH3VwgkHqQvDoDUP6iSNLEKuFvUoW8CCed3qXsbw8=; b=d glIvW2tOhXF1O/w+4RPn3yQeH2L+htmldRywTxyclz22rOeTJWyY4Saa8oSQrncq auI52/H078LfaG75gTlNFHBCGj+PPtuzKbgwM99/PBoOmg/XRdE4bVdvt7voqCkG 2ZQ+UCq48bscCThMby3OBT3L+mLVyaaJaDiuO/5OHC5fh8J33m98++DPZylC9sOc pXXSkjIypLBbTrQrfquAlf8t3CA8187r7lvzuCucOZw7kD6yTdB7qd2/tPm7u6ER jerWzoZwAVidzEXR6pQl0NkaaNPEDJOBpEtKVDAVrVCJoAP1Y0L7zRoluew8oAYS nGD2qfq7dgCwdb4zKUcHg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1658253066; x= 1658339466; bh=x3cH3VwgkHqQvDoDUP6iSNLEKuFvUoW8CCed3qXsbw8=; b=2 luJETpBXqSMgNbVX8u/If/y1hmh0hpJU0VCi1t+8ypWw61Vpwvac97LQttj71U8x 93AfrFshoIVnBhZa/2Rjd1wFNDwYuxT+yZqcIk45dhQyjrf+htpC8cJVz6LKdvIi dpjqGjPWN6hArX/QnnG4QlpcYC3ogONuX9Gk78fRSwt98q1qvvYAhmKB1erv8saD AKTyn9Vtc0vrIYLmwVPjvCCZhfgsJKkvUDlZEwQPi092tpdQsBGQNLaud95etT9T b09nCtIXphf1nAvA2m/PU/0W3Sln7XVi3eIbhM2KsG5OQflH+GJgODUCkZ5y6Xmx ZKmDw7axcC+11hOaZUMsw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeltddgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogfuuhhsphgvtghtffhomhgrihhnucdlgeelmd enucfjughrpefuvfhfvefhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegu rhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrd gtohhmqeenucggtffrrghtthgvrhhnpeehheefvdeigedtudetvdejgfeuudevueejfeff teegleegieefheehudejgffgheenucffohhmrghinhepghhithhhuhgsrdhiohenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Jul 2022 13:51:05 -0400 (EDT) Subject: Re: Out Of Memory To: ghoostinger@mail.com References: <33d864f0-84c3-90fe-af4e-4d7d09d766f7@aklaver.com> Cc: pgsql-general From: Adrian Klaver Message-ID: Date: Tue, 19 Jul 2022 10:51:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/19/22 9:56 AM, ghoostinger@mail.com wrote: Please reply to list also. Ccing list > > 1) Detail how you are doing migration > 1 - I'm Using Tool OpenUpgrade OCA > 2 - Creation new db and restore my db on it (36GB and Some table 5m+ rows) > 3 - Execution Script Sql to unistall Unwanted Modules > 4 - Switching to v12.0 > -> gitrecupdate 12.0 > 5 - Execute Shell to Unistall unwanted Modules > -> echo "self.env['base.module.upgrade'].upgrade_module()" | ./odoo/odoo-bin shell --config ./odoo12.conf -d bt --stop-after-init > 6 - Switching to 13.0 & Execute OpenUpgrade > -> gitrecupdate 13.0 > -> ./OCA/OpenUpgrade/odoo-bin --config ./openupgrade13.conf -d bt -u all --stop-after-init > 7 - Switching to 14.0 > -> gitrecupdate 14.0 > -> ./odoo/odoo-bin --config ./odoo14.conf -d bt -u all --stop-after-init I would read: https://oca.github.io/OpenUpgrade/after_migration.html I have to believe doing serial migrations with no clean up is going to eat up space where you have database of size 36GB and ram of 30GB and disk size of 100GB. > > > 2) Are you doing this on the same machine? > - Yeah, i did it on AWS Server > 3) OS and version > - Ubuntu 20.04.4 LTS > > > 4) Hardware specifications for machine e.g. memory, disk space, etc. > - Amazon AWS > - Instance Type: r6gd.xlarge > - OS: Ubuntu > - RAM: 30GB, Disk Space: 100GB > > > Note: It works till Migration to 13.0 , Stock account Migration > > —————————————— - - - > On 19/07/2022 at 3:00 PM, Adrian Klaver wrote: > >> On 7/19/22 06:16, ghoostinger@mail.com wrote: >>> Hello, I’m using Odoo Erp v12 Community and i want migrate to v14 and i have tablea content more 5m rows and after 8hr of execution it sho msg “out of memory” so i need your help >> >> And we need information: >> >> 1) Detail how you are doing migration. >> >> 2) Are you doing this on the same machine? >> >> 3) OS and version. >> >> 4) Hardware specifications for machine e.g. memory, disk space, etc. >> >> >> -- >> Adrian Klaver >> adrian.klaver@aklaver.com >> -- Adrian Klaver adrian.klaver@aklaver.com From adrian.klaver@aklaver.com Tue Jul 19 17:58:38 2022 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDrUg-0004ES-0O for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 17:58:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDrUe-00052Y-B8 for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 17:58:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDrUe-00052P-0k for pgsql-general@lists.postgresql.org; Tue, 19 Jul 2022 17:58:48 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDrUa-0003Cz-0J for pgsql-general@postgresql.org; Tue, 19 Jul 2022 17:58:47 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 4BE7D32008FC; Tue, 19 Jul 2022 13:58:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 19 Jul 2022 13:58:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1658253520; x= 1658339920; bh=ukb1z1QSfCWyNjT3z3CrjYOkrgyrekt9V0ybgTpMuPo=; b=D M3cHCbGv74MI2NNx8OSOgL5LAemyDWZA+up+E96AbLZgak9sHRNPStkfG0MhKMsm A1Kf4DWcarxDfoacH+9MlnTyZ3p0rEfo5S/ZVr/dK9OxiQB69/85c7zsdlnsX+EE iJkSPq3lMZdPCptD43IH51H3tgrzroXszBVYlqnlYeV/Jf+WlxyKBWNHVJS91Vja 043sk+NcUubUzCT/vG6bRaH7u4nEZcvHaC3EYuNA37TcJAhKhtEtP4c4UeoDkpuf ejfihHeXSeSz8mjYzHisH3MtuzfxczU4olFMlYtf1A27fE+67CgwwqK6OANEZlSU CqrixsJBRIcpa2xhuELDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1658253520; x= 1658339920; bh=ukb1z1QSfCWyNjT3z3CrjYOkrgyrekt9V0ybgTpMuPo=; b=S uQ/XVYY0p5Pd3RVgLj3/GS6MA/I7q8zgZ/r4gSOzGngbNNdgnxpWQ8TRL0WpnDqn tKNMS5gga58YWESQNolDZSv0/ko9JGr+eECnPQAZvtzQ+udkreV3tPDelpJb0bt6 YAOqf7hzzxIjxtDZCwGRbc4ZUQ8GJb70pNi7vAc4/wgoa0QKFUXWEv0a6/6PguIU OYkLq3q03WUTE6BezmSHbARrF1nCYwPftvvaiDxB5seF8fwKNtKwiNtD9Tu/n8X6 qdotvEAFg+/0iN3g/b+iYS76RDWbmeDuLkNOhdAX+dwkbAlZlFe2PBWfpAzGT7tw cyHgDcyMt3NX0Hcjqivgw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeltddguddukecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogfuuhhsphgvtghtffhomhgrihhnucdlgeelmd enucfjughrpefuvfhfvefhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegu rhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrd gtohhmqeenucggtffrrghtthgvrhhnpeekveekueduleeuuefguedtteelvdevgeekjedv ffeggffgtdehtdffgeffteelkeenucffohhmrghinhepohguohhordgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Jul 2022 13:58:39 -0400 (EDT) Subject: Re: Out Of Memory To: ghoostinger@mail.com References: <33d864f0-84c3-90fe-af4e-4d7d09d766f7@aklaver.com> Cc: pgsql-general From: Adrian Klaver Message-ID: Date: Tue, 19 Jul 2022 10:58:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/19/22 10:54 AM, ghoostinger@mail.com wrote: Again reply to list also. Ccing list. > What should i do and what’s the requirements > ———- The link explains what you should do. What requirements are you talking about? This is probably something that the Odoo community will be better able to answer: https://www.odoo.com/forum/help-1 -- Adrian Klaver adrian.klaver@aklaver.com