pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
out of memory
58+ messages / 24 participants
[nested] [flat]

* out of memory
@ 2005-04-26 14:02 Hugues-Vincent Grislin <hugues-vincent.grislin@vif.tm.fr>
  2005-04-26 18:05 ` Re: out of memory Scott Marlowe <smarlowe@g2switchworks.com>
  0 siblings, 1 reply; 58+ messages in thread

From: Hugues-Vincent Grislin @ 2005-04-26 14:02 UTC (permalink / raw)
  To: pgsql-general

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.

^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: out of memory
  2005-04-26 14:02 out of memory Hugues-Vincent Grislin <hugues-vincent.grislin@vif.tm.fr>
@ 2005-04-26 18:05 ` Scott Marlowe <smarlowe@g2switchworks.com>
  0 siblings, 0 replies; 58+ messages in thread

From: Scott Marlowe @ 2005-04-26 18:05 UTC (permalink / raw)
  To: hugues-vincent.grislin@vif.tm.fr; +Cc: pgsql-general

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.



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: out of memory
@ 2006-03-15 08:55 surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
  2006-03-15 09:17 ` Re: out of memory Antonis Antoniou <a.antoniou@albourne.com>
  0 siblings, 1 reply; 58+ messages in thread

From: surabhi.ahuja @ 2006-03-15 08:55 UTC (permalink / raw)
  To: ; +Cc: pgsql-general

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

^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: out of memory
  2006-03-15 08:55 Re: out of memory surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
@ 2006-03-15 09:17 ` Antonis Antoniou <a.antoniou@albourne.com>
  0 siblings, 0 replies; 58+ messages in thread

From: Antonis Antoniou @ 2006-03-15 09:17 UTC (permalink / raw)
  To: surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>; +Cc: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Out of memory
@ 2008-03-28 18:38 Alex Adriaanse <alex@innovacomputing.com>
  2008-03-28 20:31 ` Re: Out of memory Scott Marlowe <scott.marlowe@gmail.com>
  2008-03-28 21:57 ` Re: Out of memory Martijn van Oosterhout <kleptog@svana.org>
  0 siblings, 2 replies; 58+ messages in thread

From: Alex Adriaanse @ 2008-03-28 18:38 UTC (permalink / raw)
  To: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2008-03-28 18:38 Out of memory Alex Adriaanse <alex@innovacomputing.com>
@ 2008-03-28 20:31 ` Scott Marlowe <scott.marlowe@gmail.com>
  2008-03-28 21:20   ` Re: Out of memory Alex Adriaanse <alex@innovacomputing.com>
  1 sibling, 1 reply; 58+ messages in thread

From: Scott Marlowe @ 2008-03-28 20:31 UTC (permalink / raw)
  To: Alex Adriaanse <alex@innovacomputing.com>; +Cc: pgsql-general

On Fri, Mar 28, 2008 at 12:38 PM, Alex Adriaanse
<alex@innovacomputing.com> 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.



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2008-03-28 18:38 Out of memory Alex Adriaanse <alex@innovacomputing.com>
  2008-03-28 20:31 ` Re: Out of memory Scott Marlowe <scott.marlowe@gmail.com>
@ 2008-03-28 21:20   ` Alex Adriaanse <alex@innovacomputing.com>
  0 siblings, 0 replies; 58+ messages in thread

From: Alex Adriaanse @ 2008-03-28 21:20 UTC (permalink / raw)
  To: Scott Marlowe <scott.marlowe@gmail.com>; +Cc: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2008-03-28 18:38 Out of memory Alex Adriaanse <alex@innovacomputing.com>
@ 2008-03-28 21:57 ` Martijn van Oosterhout <kleptog@svana.org>
  2008-03-29 00:07   ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 58+ messages in thread

From: Martijn van Oosterhout @ 2008-03-28 21:57 UTC (permalink / raw)
  To: Alex Adriaanse <alex@innovacomputing.com>; +Cc: pgsql-general

On Fri, Mar 28, 2008 at 01:38:57PM -0500, Alex Adriaanse wrote:
> 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.

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,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while 
> boarding. Thank you for flying nlogn airlines.

Attachments:

  signature.asc (application/pgp-signature, 188B) download

^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2008-03-28 18:38 Out of memory Alex Adriaanse <alex@innovacomputing.com>
  2008-03-28 21:57 ` Re: Out of memory Martijn van Oosterhout <kleptog@svana.org>
@ 2008-03-29 00:07   ` Tom Lane <tgl@sss.pgh.pa.us>
  2008-03-29 00:44     ` Re: Out of memory Alex Adriaanse <alex@innovacomputing.com>
  0 siblings, 1 reply; 58+ messages in thread

From: Tom Lane @ 2008-03-29 00:07 UTC (permalink / raw)
  To: Martijn van Oosterhout <kleptog@svana.org>; +Cc: Alex Adriaanse <alex@innovacomputing.com>; pgsql-general

Martijn van Oosterhout <kleptog@svana.org> 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



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2008-03-28 18:38 Out of memory Alex Adriaanse <alex@innovacomputing.com>
  2008-03-28 21:57 ` Re: Out of memory Martijn van Oosterhout <kleptog@svana.org>
  2008-03-29 00:07   ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
@ 2008-03-29 00:44     ` Alex Adriaanse <alex@innovacomputing.com>
  2008-03-29 00:51       ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 58+ messages in thread

From: Alex Adriaanse @ 2008-03-29 00:44 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Martijn van Oosterhout <kleptog@svana.org>; pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2008-03-28 18:38 Out of memory Alex Adriaanse <alex@innovacomputing.com>
  2008-03-28 21:57 ` Re: Out of memory Martijn van Oosterhout <kleptog@svana.org>
  2008-03-29 00:07   ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
  2008-03-29 00:44     ` Re: Out of memory Alex Adriaanse <alex@innovacomputing.com>
@ 2008-03-29 00:51       ` Tom Lane <tgl@sss.pgh.pa.us>
  2008-04-04 20:24         ` Re: Out of memory Alex Adriaanse <alex@innovacomputing.com>
  0 siblings, 1 reply; 58+ messages in thread

From: Tom Lane @ 2008-03-29 00:51 UTC (permalink / raw)
  To: Alex Adriaanse <alex@innovacomputing.com>; +Cc: Martijn van Oosterhout <kleptog@svana.org>; pgsql-general

Alex Adriaanse <alex@innovacomputing.com> 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



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2008-03-28 18:38 Out of memory Alex Adriaanse <alex@innovacomputing.com>
  2008-03-28 21:57 ` Re: Out of memory Martijn van Oosterhout <kleptog@svana.org>
  2008-03-29 00:07   ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
  2008-03-29 00:44     ` Re: Out of memory Alex Adriaanse <alex@innovacomputing.com>
  2008-03-29 00:51       ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
@ 2008-04-04 20:24         ` Alex Adriaanse <alex@innovacomputing.com>
  2008-04-04 21:48           ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 58+ messages in thread

From: Alex Adriaanse @ 2008-04-04 20:24 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Martijn van Oosterhout <kleptog@svana.org>; pgsql-general

Tom Lane wrote:
> Alex Adriaanse <alex@innovacomputing.com> 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 <transformExpr+53>:    callq  0x562c00 <check_stack_depth>

(gdb) x/i 0x000000000049ea00
0x49ea00 <transformExpr>:       mov    %rbx,0xffffffffffffffd0(%rsp)

(gdb) x/i 0x00000000005e7b13
0x5e7b13 <pfree+3>:     mov    0xfffffffffffffff0(%rdi),%rdi

I hope this helps.

Alex




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2008-03-28 18:38 Out of memory Alex Adriaanse <alex@innovacomputing.com>
  2008-03-28 21:57 ` Re: Out of memory Martijn van Oosterhout <kleptog@svana.org>
  2008-03-29 00:07   ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
  2008-03-29 00:44     ` Re: Out of memory Alex Adriaanse <alex@innovacomputing.com>
  2008-03-29 00:51       ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
  2008-04-04 20:24         ` Re: Out of memory Alex Adriaanse <alex@innovacomputing.com>
@ 2008-04-04 21:48           ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 58+ messages in thread

From: Tom Lane @ 2008-04-04 21:48 UTC (permalink / raw)
  To: Alex Adriaanse <alex@innovacomputing.com>; +Cc: Martijn van Oosterhout <kleptog@svana.org>; pgsql-general

Alex Adriaanse <alex@innovacomputing.com> 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 <transformExpr+53>:    callq  0x562c00 <check_stack_depth>

> (gdb) x/i 0x000000000049ea00
> 0x49ea00 <transformExpr>:       mov    %rbx,0xffffffffffffffd0(%rsp)

> (gdb) x/i 0x00000000005e7b13
> 0x5e7b13 <pfree+3>:     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



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Out of memory
@ 2011-03-25 03:23 Jeremy Palmer <JPalmer@linz.govt.nz>
  2011-03-25 04:04 ` Re: Out of memory Scott Marlowe <scott.marlowe@gmail.com>
  0 siblings, 1 reply; 58+ messages in thread

From: Jeremy Palmer @ 2011-03-25 03:23 UTC (permalink / raw)
  To: pgsql-general

I've been getting database out of memory failures with some queries which 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'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=0
vm.overcommit_memory=2
kernel.shmmax = 4196769792
kernel.shmall = 1024602

And the PostgreSQL is:

PostgreSQL 9.0.3 on x86_64-pc-linux-gnu, compiled by GCC 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 = 2048MB
maintenance_work_mem = 512MB
work_mem = 200MB
wal_buffers = 16MB
effective_cache_size = 4094MB

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

Cheers,
Jeremy



______________________________________________________________________________________________________

This message contains information, which is confidential and may be subject 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 message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________

^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2011-03-25 03:23 Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
@ 2011-03-25 04:04 ` Scott Marlowe <scott.marlowe@gmail.com>
  2011-03-26 08:57   ` Re: Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
  0 siblings, 1 reply; 58+ messages in thread

From: Scott Marlowe @ 2011-03-25 04:04 UTC (permalink / raw)
  To: Jeremy Palmer <JPalmer@linz.govt.nz>; +Cc: pgsql-general

On Thu, Mar 24, 2011 at 9:23 PM, Jeremy Palmer <JPalmer@linz.govt.nz> wrote:
> I’ve been getting database out of memory failures with some queries which
> 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’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 = 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.



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2011-03-25 03:23 Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
  2011-03-25 04:04 ` Re: Out of memory Scott Marlowe <scott.marlowe@gmail.com>
@ 2011-03-26 08:57   ` Jeremy Palmer <JPalmer@linz.govt.nz>
  2011-03-26 15:42     ` Re: Out of memory pasman pasmański <pasman.p@gmail.com>
  2011-03-29 03:58     ` Re: Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
  0 siblings, 2 replies; 58+ messages in thread

From: Jeremy Palmer @ 2011-03-26 08:57 UTC (permalink / raw)
  To: Scott Marlowe <scott.marlowe@gmail.com>; +Cc: pgsql-general

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 function, 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 <JPalmer@linz.govt.nz> wrote:
> I’ve been getting database out of memory failures with some queries which
> 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’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 = 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 subject 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 message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2011-03-25 03:23 Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
  2011-03-25 04:04 ` Re: Out of memory Scott Marlowe <scott.marlowe@gmail.com>
  2011-03-26 08:57   ` Re: Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
@ 2011-03-26 15:42     ` pasman pasmański <pasman.p@gmail.com>
  1 sibling, 0 replies; 58+ messages in thread

From: pasman pasmański @ 2011-03-26 15:42 UTC (permalink / raw)
  To: Jeremy Palmer <JPalmer@linz.govt.nz>; +Cc: pgsql-general

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 <JPalmer@linz.govt.nz>:
> 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 function,
> 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 <JPalmer@linz.govt.nz> wrote:
>> I’ve been getting database out of memory failures with some queries which
>> 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’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 = 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 subject
> 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 message.
> 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
>


-- 
------------
pasman



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2011-03-25 03:23 Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
  2011-03-25 04:04 ` Re: Out of memory Scott Marlowe <scott.marlowe@gmail.com>
  2011-03-26 08:57   ` Re: Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
@ 2011-03-29 03:58     ` Jeremy Palmer <JPalmer@linz.govt.nz>
  1 sibling, 0 replies; 58+ messages in thread

From: Jeremy Palmer @ 2011-03-29 03:58 UTC (permalink / raw)
  To: Jeremy Palmer <JPalmer@linz.govt.nz>; +Cc: pgsql-general; Scott Marlowe <scott.marlowe@gmail.com>

I'm wondering if there is a way to estimate the total amount of work memory that will be used for a single query (or more specifically a plpgsql function that runs a series of queries) 

The database that I'm setting up is a data warehouse which typically only has one query running at any given time.

Thanks,
Jeremy

-----Original Message-----
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 function executed.

Just so I understand this. Every time a sort is performed within a function, 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 <JPalmer@linz.govt.nz> wrote:
> I've been getting database out of memory failures with some queries which
> 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'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 = 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 subject 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 message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Out of memory
@ 2011-04-05 09:50 Jeremy Palmer <JPalmer@linz.govt.nz>
  2011-04-05 19:06 ` Re: Out of memory Jeff Davis <pgsql@j-davis.com>
  2011-04-05 19:27 ` Re: Out of memory John R Pierce <pierce@hogranch.com>
  2011-04-12 10:11 ` Re: Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
  0 siblings, 3 replies; 58+ messages in thread

From: Jeremy Palmer @ 2011-04-05 09:50 UTC (permalink / raw)
  To: pgsql-general

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:

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.

The server log error message I'm getting in the function is here http://pastebin.com/346zi2sS. It's very long and contains the top transaction memory debug info.

My initial observation about this error is that maybe PostgreSQL is encountering a memory corruption error because the amount of OS memory does not seem to run out. The plpgsql function uses functions from both PostGIS and pgc_checksum (http://pgfoundry.org/projects/pg-comparator) - so maybe they are the cause of the problem. Or maybe I have configured something wrong...

I did some memory logging during and the execution of the function. It shows 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:

             total       used       free     shared    buffers     cached
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:

             total       used       free     shared    buffers     cached
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:

             total       used       free     shared    buffers     cached
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’s a running on VMWare and, has 2 CPU’s and 8GB of RAM. This VM is dedicated to PostgreSQL, not much else is running other than cacti, ssh and ftp server daemons. The main OS parameters I have tuned are:
 
vm.swappiness=0
vm.overcommit_memory=2
kernel.shmmax = 4196769792
kernel.shmall = 1024602
 
And the PostgreSQL is:
 
PostgreSQL 9.0.3 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5) 4.4.3, 64-bit.
 
The main changed postgresql.conf parameters I've tuned are:
 
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.

Two questions:

1) Have I set the OS and postgresql parameter to sensible values given the hardware and database utilization.
2) Can anyone help me make sense of the top transaction memory error to help 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 function executed.

Just so I understand this. Every time a sort is performed within a function, 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 <JPalmer@linz.govt.nz> wrote:
> I’ve been getting database out of memory failures with some queries which
> 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’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 = 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 subject 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 message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2011-04-05 09:50 Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
@ 2011-04-05 19:06 ` Jeff Davis <pgsql@j-davis.com>
  2 siblings, 0 replies; 58+ messages in thread

From: Jeff Davis @ 2011-04-05 19:06 UTC (permalink / raw)
  To: Jeremy Palmer <JPalmer@linz.govt.nz>; +Cc: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2011-04-05 09:50 Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
@ 2011-04-05 19:27 ` John R Pierce <pierce@hogranch.com>
  2 siblings, 0 replies; 58+ messages in thread

From: John R Pierce @ 2011-04-05 19:27 UTC (permalink / raw)
  To: pgsql-general

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.



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
  2011-04-05 09:50 Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
@ 2011-04-12 10:11 ` Jeremy Palmer <JPalmer@linz.govt.nz>
  2 siblings, 0 replies; 58+ messages in thread

From: Jeremy Palmer @ 2011-04-12 10:11 UTC (permalink / raw)
  To: pgsql-general

Well after a few days of further investigation I still can't track the issue down. The main problem I can only reproduce the error running the whole 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 posting to this list.

Does anyone have an idea of how I might go about trying to tackle this problem now. Should I try further reducing the memory settings? Or install a debug version of PostgreSQL and get some further information about what is going on before the error. Any advice would be greatly appreciated.

Regards,
Jeremy 

________________________________________
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 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.

The server log error message I'm getting in the function is here http://pastebin.com/346zi2sS. It's very long and contains the top transaction memory debug info.

My initial observation about this error is that maybe PostgreSQL is encountering a memory corruption error because the amount of OS memory does not seem to run out. The plpgsql function uses functions from both PostGIS and pgc_checksum (http://pgfoundry.org/projects/pg-comparator) - so maybe they are the cause of the problem. Or maybe I have configured something wrong...

I did some memory logging during and the execution of the function. It shows 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:

             total       used       free     shared    buffers     cached
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:

             total       used       free     shared    buffers     cached
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:

             total       used       free     shared    buffers     cached
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’s a running on VMWare and, has 2 CPU’s and 8GB of RAM. This VM is dedicated to PostgreSQL, not much else is running other than cacti, ssh and ftp server daemons. The main OS parameters I have tuned are:

vm.swappiness=0
vm.overcommit_memory=2
kernel.shmmax = 4196769792
kernel.shmall = 1024602

And the PostgreSQL is:

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

The main changed postgresql.conf parameters I've tuned are:

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.

Two questions:

1) Have I set the OS and postgresql parameter to sensible values given the hardware and database utilization.
2) Can anyone help me make sense of the top transaction memory error to help track down the issue?

Any other suggestions would be greatly appreciated.

Thanks
Jeremy
______________________________________________________________________________________________________

This message contains information, which is confidential and may be subject 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 message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
@ 2011-04-05 22:44 Jeremy Palmer <JPalmer@linz.govt.nz>
  0 siblings, 0 replies; 58+ messages in thread

From: Jeremy Palmer @ 2011-04-05 22:44 UTC (permalink / raw)
  To: pierce@hogranch.com <pierce@hogranch.com>; pgsql-general

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 created in the same transaction, so that if an error occurs the database is rolled back to the last successfully applied changeset. I don't want to get into the business of the splitting it into separate transactions and then having to revert changes that were applied in a previous transaction step.

> 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?

They are not necessary, but it has the cleanest code implementation and makes the revision maintenance to the tables almost transparent. If they are 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 functions and multiple temp tables. The overall time to create these tables is somewhere in the area of 3hours on this server. I'm also unloading these tables multiple times for separate purposes, so they would need to be materialised anyway.

> with only 1-2 connections, you certainly could increase the work_mem. 

I can't increase this value at the moment on this server because I was getting out of memory errors with the initial population of the database (which builds the denormalized tables, but does not determine the changeset to the previous table revision). 

I tried values, 256mb - 2mb and could only get the query to run with 1mb. I suspect even this was pushing the boundary, so when I got to the next stage in my testing - to apply incremental updates - the memory issue raised it head again.

Regards,
Jeremy

______________________________________________________________________________________________________

This message contains information, which is confidential and may be subject 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 message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of memory
@ 2011-04-06 05:36 Jeremy Palmer <JPalmer@linz.govt.nz>
  0 siblings, 0 replies; 58+ messages in thread

From: Jeremy Palmer @ 2011-04-06 05:36 UTC (permalink / raw)
  To: pgsql@j-davis.com <pgsql@j-davis.com>; pgsql-general

Hi Jeff,

< Where is the source to the function? 

The source is located here: https://github.com/linz/linz_bde_uploader

The main function LDS_MaintainSimplifiedLayers that is being called is on line 37 is in https://github.com/linz/linz_bde_uploader/blob/master/sql/lds_layer_functions.sql. 

The actual out of memory exception was caught with the bde_GetTableDifferences function source file on line 3263 in https://github.com/linz/linz_bde_uploader/blob/master/sql/bde_control_functions.sql.

When I was actually getting an out of memory issue when creating the tables (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_uploader/blob/master/sql/lds_layer_functions.sql. After I dropped the work_mem to 1MB it got past that and completed ok. But during the maintenance of the table the row differences need to be calculated and then applied to the table. See the LDS_ApplyTableDifferences function on line 353.

Regards,
Jeremy
______________________________________________________________________________________________________

This message contains information, which is confidential and may be subject 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 message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Out of Memory
@ 2015-01-15 23:17 Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 00:19 ` Re: Out of Memory John R Pierce <pierce@hogranch.com>
  2015-01-16 01:18 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 58+ messages in thread

From: Enrico Bianchi @ 2015-01-15 23:17 UTC (permalink / raw)
  To: pgsql-general

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

^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2015-01-15 23:17 Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
@ 2015-01-16 00:19 ` John R Pierce <pierce@hogranch.com>
  2015-01-16 08:59   ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  1 sibling, 1 reply; 58+ messages in thread

From: John R Pierce @ 2015-01-16 00:19 UTC (permalink / raw)
  To: pgsql-general

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



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2015-01-15 23:17 Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 00:19 ` Re: Out of Memory John R Pierce <pierce@hogranch.com>
@ 2015-01-16 08:59   ` Enrico Bianchi <enrico.bianchi@ymail.com>
  0 siblings, 0 replies; 58+ messages in thread

From: Enrico Bianchi @ 2015-01-16 08:59 UTC (permalink / raw)
  To: pgsql-general

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



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2015-01-15 23:17 Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
@ 2015-01-16 01:18 ` Tom Lane <tgl@sss.pgh.pa.us>
  2015-01-16 08:58   ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  1 sibling, 1 reply; 58+ messages in thread

From: Tom Lane @ 2015-01-16 01:18 UTC (permalink / raw)
  To: Enrico Bianchi <enrico.bianchi@ymail.com>; +Cc: pgsql-general

Enrico Bianchi <enrico.bianchi@ymail.com> 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



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2015-01-15 23:17 Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 01:18 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-01-16 08:58   ` Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 10:22     ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  0 siblings, 1 reply; 58+ messages in thread

From: Enrico Bianchi @ 2015-01-16 08:58 UTC (permalink / raw)
  To: pgsql-general

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



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2015-01-15 23:17 Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 01:18 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2015-01-16 08:58   ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
@ 2015-01-16 10:22     ` Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 11:57       ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  0 siblings, 1 reply; 58+ messages in thread

From: Enrico Bianchi @ 2015-01-16 10:22 UTC (permalink / raw)
  To: pgsql-general

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



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2015-01-15 23:17 Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 01:18 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2015-01-16 08:58   ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 10:22     ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
@ 2015-01-16 11:57       ` Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 14:37         ` Re: Out of Memory Chris Mair <chris@1006.org>
  0 siblings, 1 reply; 58+ messages in thread

From: Enrico Bianchi @ 2015-01-16 11:57 UTC (permalink / raw)
  To: pgsql-general

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



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2015-01-15 23:17 Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 01:18 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2015-01-16 08:58   ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 10:22     ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 11:57       ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
@ 2015-01-16 14:37         ` Chris Mair <chris@1006.org>
  2015-01-16 16:23           ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 58+ messages in thread

From: Chris Mair @ 2015-01-16 14:37 UTC (permalink / raw)
  To: Enrico Bianchi <enrico.bianchi@ymail.com>; pgsql-general


>> 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



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2015-01-15 23:17 Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 01:18 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2015-01-16 08:58   ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 10:22     ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 11:57       ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
  2015-01-16 14:37         ` Re: Out of Memory Chris Mair <chris@1006.org>
@ 2015-01-16 16:23           ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 58+ messages in thread

From: Tom Lane @ 2015-01-16 16:23 UTC (permalink / raw)
  To: Chris Mair <chris@1006.org>; +Cc: Enrico Bianchi <enrico.bianchi@ymail.com>; pgsql-general

Chris Mair <chris@1006.org> 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



^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Out of Memory
@ 2018-09-20 22:11 greigwise <greigwise@comcast.net>
  2018-09-20 22:16 ` Re: Out of Memory Paul Carlucci <paul.carlucci@gmail.com>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 58+ messages in thread

From: greigwise @ 2018-09-20 22:11 UTC (permalink / raw)
  To: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
@ 2018-09-20 22:16 ` Paul Carlucci <paul.carlucci@gmail.com>
  2018-09-20 22:22   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  1 sibling, 1 reply; 58+ messages in thread

From: Paul Carlucci @ 2018-09-20 22:16 UTC (permalink / raw)
  To: greigwise <greigwise@comcast.net>; +Cc: pgsql-general

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 <greigwise@comcast.net> 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
>
>

^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:16 ` Re: Out of Memory Paul Carlucci <paul.carlucci@gmail.com>
@ 2018-09-20 22:22   ` greigwise <greigwise@comcast.net>
  0 siblings, 0 replies; 58+ messages in thread

From: greigwise @ 2018-09-20 22:22 UTC (permalink / raw)
  To: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
@ 2018-09-20 22:51 ` Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  1 sibling, 1 reply; 58+ messages in thread

From: Tom Lane @ 2018-09-20 22:51 UTC (permalink / raw)
  To: greigwise <greigwise@comcast.net>; +Cc: pgsql-general

greigwise <greigwise@comcast.net> 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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
@ 2018-09-21 13:20   ` greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  0 siblings, 1 reply; 58+ messages in thread

From: greigwise @ 2018-09-21 13:20 UTC (permalink / raw)
  To: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
@ 2018-09-25 18:34     ` greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:04       ` Re: Out of Memory PT <wmoran@potentialtech.com>
  0 siblings, 2 replies; 58+ messages in thread

From: greigwise @ 2018-09-25 18:34 UTC (permalink / raw)
  To: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
@ 2018-09-25 20:13       ` Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
  1 sibling, 1 reply; 58+ messages in thread

From: Tom Lane @ 2018-09-25 20:13 UTC (permalink / raw)
  To: greigwise <greigwise@comcast.net>; +Cc: pgsql-general

greigwise <greigwise@comcast.net> 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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
@ 2018-09-25 21:02         ` greigwise <greigwise@comcast.net>
  2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
  0 siblings, 1 reply; 58+ messages in thread

From: greigwise @ 2018-09-25 21:02 UTC (permalink / raw)
  To: pgsql-general

Tom Lane-2 wrote
> greigwise &lt;

> greigwise@

> &gt; 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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
@ 2018-09-26 14:24           ` greigwise <greigwise@comcast.net>
  2018-09-26 14:37             ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 58+ messages in thread

From: greigwise @ 2018-09-26 14:24 UTC (permalink / raw)
  To: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
@ 2018-09-26 14:37             ` Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 14:49               ` Re: Out of Memory greigwise <greigwise@comcast.net>
  0 siblings, 1 reply; 58+ messages in thread

From: Tom Lane @ 2018-09-26 14:37 UTC (permalink / raw)
  To: greigwise <greigwise@comcast.net>; +Cc: pgsql-general

greigwise <greigwise@comcast.net> 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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:37             ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
@ 2018-09-26 14:49               ` greigwise <greigwise@comcast.net>
  2018-09-26 16:24                 ` Re: Out of Memory greigwise <greigwise@comcast.net>
  0 siblings, 1 reply; 58+ messages in thread

From: greigwise @ 2018-09-26 14:49 UTC (permalink / raw)
  To: pgsql-general

Tom Lane-2 wrote
> greigwise &lt;

> greigwise@

> &gt; 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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:37             ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 14:49               ` Re: Out of Memory greigwise <greigwise@comcast.net>
@ 2018-09-26 16:24                 ` greigwise <greigwise@comcast.net>
  2018-09-26 16:32                   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  0 siblings, 1 reply; 58+ messages in thread

From: greigwise @ 2018-09-26 16:24 UTC (permalink / raw)
  To: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:37             ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 14:49               ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:24                 ` Re: Out of Memory greigwise <greigwise@comcast.net>
@ 2018-09-26 16:32                   ` greigwise <greigwise@comcast.net>
  2018-09-26 18:05                     ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 58+ messages in thread

From: greigwise @ 2018-09-26 16:32 UTC (permalink / raw)
  To: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:37             ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 14:49               ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:24                 ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:32                   ` Re: Out of Memory greigwise <greigwise@comcast.net>
@ 2018-09-26 18:05                     ` Laurenz Albe <laurenz.albe@cybertec.at>
  2018-09-27 06:30                       ` Re: Out of Memory Christoph Moench-Tegeder <cmt@burggraben.net>
  0 siblings, 1 reply; 58+ messages in thread

From: Laurenz Albe @ 2018-09-26 18:05 UTC (permalink / raw)
  To: greigwise <greigwise@comcast.net>; pgsql-general

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





^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:37             ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 14:49               ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:24                 ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:32                   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 18:05                     ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
@ 2018-09-27 06:30                       ` Christoph Moench-Tegeder <cmt@burggraben.net>
  2018-09-27 21:45                         ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 58+ messages in thread

From: Christoph Moench-Tegeder @ 2018-09-27 06:30 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

## 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.




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:37             ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 14:49               ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:24                 ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:32                   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 18:05                     ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
  2018-09-27 06:30                       ` Re: Out of Memory Christoph Moench-Tegeder <cmt@burggraben.net>
@ 2018-09-27 21:45                         ` Laurenz Albe <laurenz.albe@cybertec.at>
  2018-09-28 00:05                           ` Re: Out of Memory Rob Sargent <robjsargent@gmail.com>
  0 siblings, 1 reply; 58+ messages in thread

From: Laurenz Albe @ 2018-09-27 21:45 UTC (permalink / raw)
  To: Christoph Moench-Tegeder <cmt@burggraben.net>; pgsql-general@lists.postgresql.org

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





^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:37             ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 14:49               ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:24                 ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:32                   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 18:05                     ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
  2018-09-27 06:30                       ` Re: Out of Memory Christoph Moench-Tegeder <cmt@burggraben.net>
  2018-09-27 21:45                         ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
@ 2018-09-28 00:05                           ` Rob Sargent <robjsargent@gmail.com>
  2018-09-28 05:23                             ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 58+ messages in thread

From: Rob Sargent @ 2018-09-28 00:05 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Christoph Moench-Tegeder <cmt@burggraben.net>; pgsql-general@lists.postgresql.org



> On Sep 27, 2018, at 3:45 PM, Laurenz Albe <laurenz.albe@cybertec.at> 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?




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:37             ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 14:49               ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:24                 ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:32                   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 18:05                     ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
  2018-09-27 06:30                       ` Re: Out of Memory Christoph Moench-Tegeder <cmt@burggraben.net>
  2018-09-27 21:45                         ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
  2018-09-28 00:05                           ` Re: Out of Memory Rob Sargent <robjsargent@gmail.com>
@ 2018-09-28 05:23                             ` Laurenz Albe <laurenz.albe@cybertec.at>
  2018-09-29 10:25                               ` Re: Out of Memory Peter J. Holzer <hjp-pgsql@hjp.at>
  0 siblings, 1 reply; 58+ messages in thread

From: Laurenz Albe @ 2018-09-28 05:23 UTC (permalink / raw)
  To: Rob Sargent <robjsargent@gmail.com>; +Cc: Christoph Moench-Tegeder <cmt@burggraben.net>; pgsql-general@lists.postgresql.org

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





^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 14:37             ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 14:49               ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:24                 ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 16:32                   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-26 18:05                     ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
  2018-09-27 06:30                       ` Re: Out of Memory Christoph Moench-Tegeder <cmt@burggraben.net>
  2018-09-27 21:45                         ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
  2018-09-28 00:05                           ` Re: Out of Memory Rob Sargent <robjsargent@gmail.com>
  2018-09-28 05:23                             ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
@ 2018-09-29 10:25                               ` Peter J. Holzer <hjp-pgsql@hjp.at>
  0 siblings, 0 replies; 58+ messages in thread

From: Peter J. Holzer @ 2018-09-29 10:25 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 2018-09-28 07:23:59 +0200, Laurenz Albe wrote:
> 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.

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". 

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. 

        hp


-- 
   _  | 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 <https://www.edge.org/;

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
@ 2018-09-25 21:04       ` PT <wmoran@potentialtech.com>
  2018-09-25 21:12         ` Re: Out of Memory Tory M Blue <tmblue@gmail.com>
  1 sibling, 1 reply; 58+ messages in thread

From: PT @ 2018-09-25 21:04 UTC (permalink / raw)
  To: greigwise <greigwise@comcast.net>; +Cc: pgsql-general

On Tue, 25 Sep 2018 11:34:19 -0700 (MST)
greigwise <greigwise@comcast.net> 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




^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out of Memory
  2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
  2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
  2018-09-25 21:04       ` Re: Out of Memory PT <wmoran@potentialtech.com>
@ 2018-09-25 21:12         ` Tory M Blue <tmblue@gmail.com>
  0 siblings, 0 replies; 58+ messages in thread

From: Tory M Blue @ 2018-09-25 21:12 UTC (permalink / raw)
  To: wmoran@potentialtech.com; +Cc: pgsql-general

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 <greigwise@comcast.net> 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

^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Out Of Memory
@ 2022-07-19 13:16 ghoostinger@mail.com
  2022-07-19 15:00 ` Re: Out Of Memory Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 58+ messages in thread

From: ghoostinger@mail.com @ 2022-07-19 13:16 UTC (permalink / raw)
  To: pgsql-general

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





^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out Of Memory
  2022-07-19 13:16 Out Of Memory ghoostinger@mail.com
@ 2022-07-19 15:00 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2022-07-19 17:51   ` Re: Out Of Memory Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 58+ messages in thread

From: Adrian Klaver @ 2022-07-19 15:00 UTC (permalink / raw)
  To: ghoostinger@mail.com; pgsql-general

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





^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out Of Memory
  2022-07-19 13:16 Out Of Memory ghoostinger@mail.com
  2022-07-19 15:00 ` Re: Out Of Memory Adrian Klaver <adrian.klaver@aklaver.com>
@ 2022-07-19 17:51   ` Adrian Klaver <adrian.klaver@aklaver.com>
  2022-07-19 17:58     ` Re: Out Of Memory Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 58+ messages in thread

From: Adrian Klaver @ 2022-07-19 17:51 UTC (permalink / raw)
  To: ghoostinger@mail.com; +Cc: pgsql-general

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





^ permalink  raw  reply  [nested|flat] 58+ messages in thread

* Re: Out Of Memory
  2022-07-19 13:16 Out Of Memory ghoostinger@mail.com
  2022-07-19 15:00 ` Re: Out Of Memory Adrian Klaver <adrian.klaver@aklaver.com>
  2022-07-19 17:51   ` Re: Out Of Memory Adrian Klaver <adrian.klaver@aklaver.com>
@ 2022-07-19 17:58     ` Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 0 replies; 58+ messages in thread

From: Adrian Klaver @ 2022-07-19 17:58 UTC (permalink / raw)
  To: ghoostinger@mail.com; +Cc: pgsql-general

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





^ permalink  raw  reply  [nested|flat] 58+ messages in thread


end of thread, other threads:[~2022-07-19 17:58 UTC | newest]

Thread overview: 58+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-26 14:02 out of memory Hugues-Vincent Grislin <hugues-vincent.grislin@vif.tm.fr>
2005-04-26 18:05 ` Scott Marlowe <smarlowe@g2switchworks.com>
2006-03-15 08:55 Re: out of memory surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
2006-03-15 09:17 ` Antonis Antoniou <a.antoniou@albourne.com>
2008-03-28 18:38 Out of memory Alex Adriaanse <alex@innovacomputing.com>
2008-03-28 20:31 ` Re: Out of memory Scott Marlowe <scott.marlowe@gmail.com>
2008-03-28 21:20   ` Re: Out of memory Alex Adriaanse <alex@innovacomputing.com>
2008-03-28 21:57 ` Re: Out of memory Martijn van Oosterhout <kleptog@svana.org>
2008-03-29 00:07   ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
2008-03-29 00:44     ` Re: Out of memory Alex Adriaanse <alex@innovacomputing.com>
2008-03-29 00:51       ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
2008-04-04 20:24         ` Re: Out of memory Alex Adriaanse <alex@innovacomputing.com>
2008-04-04 21:48           ` Re: Out of memory Tom Lane <tgl@sss.pgh.pa.us>
2011-03-25 03:23 Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
2011-03-25 04:04 ` Re: Out of memory Scott Marlowe <scott.marlowe@gmail.com>
2011-03-26 08:57   ` Re: Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
2011-03-26 15:42     ` Re: Out of memory pasman pasmański <pasman.p@gmail.com>
2011-03-29 03:58     ` Re: Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
2011-04-05 09:50 Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
2011-04-05 19:06 ` Re: Out of memory Jeff Davis <pgsql@j-davis.com>
2011-04-05 19:27 ` Re: Out of memory John R Pierce <pierce@hogranch.com>
2011-04-12 10:11 ` Re: Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
2011-04-05 22:44 Re: Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
2011-04-06 05:36 Re: Out of memory Jeremy Palmer <JPalmer@linz.govt.nz>
2015-01-15 23:17 Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
2015-01-16 00:19 ` Re: Out of Memory John R Pierce <pierce@hogranch.com>
2015-01-16 08:59   ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
2015-01-16 01:18 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
2015-01-16 08:58   ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
2015-01-16 10:22     ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
2015-01-16 11:57       ` Re: Out of Memory Enrico Bianchi <enrico.bianchi@ymail.com>
2015-01-16 14:37         ` Re: Out of Memory Chris Mair <chris@1006.org>
2015-01-16 16:23           ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
2018-09-20 22:11 Out of Memory greigwise <greigwise@comcast.net>
2018-09-20 22:16 ` Re: Out of Memory Paul Carlucci <paul.carlucci@gmail.com>
2018-09-20 22:22   ` Re: Out of Memory greigwise <greigwise@comcast.net>
2018-09-20 22:51 ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
2018-09-21 13:20   ` Re: Out of Memory greigwise <greigwise@comcast.net>
2018-09-25 18:34     ` Re: Out of Memory greigwise <greigwise@comcast.net>
2018-09-25 20:13       ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
2018-09-25 21:02         ` Re: Out of Memory greigwise <greigwise@comcast.net>
2018-09-26 14:24           ` Re: Out of Memory greigwise <greigwise@comcast.net>
2018-09-26 14:37             ` Re: Out of Memory Tom Lane <tgl@sss.pgh.pa.us>
2018-09-26 14:49               ` Re: Out of Memory greigwise <greigwise@comcast.net>
2018-09-26 16:24                 ` Re: Out of Memory greigwise <greigwise@comcast.net>
2018-09-26 16:32                   ` Re: Out of Memory greigwise <greigwise@comcast.net>
2018-09-26 18:05                     ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
2018-09-27 06:30                       ` Re: Out of Memory Christoph Moench-Tegeder <cmt@burggraben.net>
2018-09-27 21:45                         ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
2018-09-28 00:05                           ` Re: Out of Memory Rob Sargent <robjsargent@gmail.com>
2018-09-28 05:23                             ` Re: Out of Memory Laurenz Albe <laurenz.albe@cybertec.at>
2018-09-29 10:25                               ` Re: Out of Memory Peter J. Holzer <hjp-pgsql@hjp.at>
2018-09-25 21:04       ` Re: Out of Memory PT <wmoran@potentialtech.com>
2018-09-25 21:12         ` Re: Out of Memory Tory M Blue <tmblue@gmail.com>
2022-07-19 13:16 Out Of Memory ghoostinger@mail.com
2022-07-19 15:00 ` Re: Out Of Memory Adrian Klaver <adrian.klaver@aklaver.com>
2022-07-19 17:51   ` Re: Out Of Memory Adrian Klaver <adrian.klaver@aklaver.com>
2022-07-19 17:58     ` Re: Out Of Memory Adrian Klaver <adrian.klaver@aklaver.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox