Re: Does RelCache/SysCache shrink except when relations are deleted?

From: "MauMau" <maumau307(at)gmail(dot)com>
To: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Does RelCache/SysCache shrink except when relations are deleted?
Date: 2011-09-29 12:23:48
Message-ID: E42C0ACB68784EAD87F08551E7B7E8C7@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
can we see all of your memory settings plus physical memory? the
solution is probably going to be reducing shared buffers an/or adding
physical memory.

Thank you for your response.

The amount of physical memory is 8GB, which is enough for the workload. I
asked the customer for the output of "SHOW ALL", but I haven't received it
yet. However, shared_buffers should be less than 1.6GB because, as I wrote
in the previous mail, top command showed 1.6GB in "VIRT" column before
executing somefunc() PL/pgSQL function.

The direct cause of "out of memory" is that the virtual memory became full.
32-bit Linux can allocate 3GB of user space in the virtual address space of
each process. somefunc() used 1.0GB, which led to 2.6GB of virtual memory.
After somefunc(), VACUUM tried to allocate 256MB of maintenance_work_mem.
That allocation failed because the virtual address space was almost full.

As you mentioned, decreasing shared_buffers will be one of the solutions.
However, we want to know why somefunc() uses so much memory. Therefore, the
following is the core question. Q2 and Q3 are supplementary ones. It is just
my guess that RelCache/SysCache may be the cause.

2011/9/28 MauMau <maumau307(at)gmail(dot)com>:
> Q1: When are the RelCache/SysCache entries removed from
> CacheMemoryContext?
> Are they removed only when the corresponding relations are deleted? If so,
> "many tables and indexes" is not friendly for the current PostgreSQL?

Regards
MauMau

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dickson S. Guedes 2011-09-29 12:45:55 Re: Feature proposal: www_fdw
Previous Message Fujii Masao 2011-09-29 12:21:32 Re: [REVIEW] pg_last_xact_insert_timestamp