From: Dawid Kuroczko <qnex42@gmail.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: PL/pgSQL memory consumption?
Date: Fri, 22 Feb 2008 14:23:42 +0100
Message-ID: <758d5e7f0802220523x12a444ap679e51b990190ccc@mail.gmail.com> (raw)
Hi there,
I have recently found a nice utility called memstat (which shows how
much of private
(not shared)) memory each process uses. What kind of surprised me was
the amount
of memory that is used by PL/pgSQL (one more reason not to provide it
by default? ;-)).
For example:
# sysctl -w|grep plpgsql.so|head -6
39048k: PID 23814 (/usr/lib/postgresql/8.2/lib/plpgsql.so)
38972k: PID 23815 (/usr/lib/postgresql/8.2/lib/plpgsql.so)
39048k: PID 23817 (/usr/lib/postgresql/8.2/lib/plpgsql.so)
39048k: PID 23822 (/usr/lib/postgresql/8.2/lib/plpgsql.so)
39048k: PID 23825 (/usr/lib/postgresql/8.2/lib/plpgsql.so)
39048k: PID 23835 (/usr/lib/postgresql/8.2/lib/plpgsql.so)
Its an x86_64 platform, memory settings are:
temp_buffers = 8MB
work_mem = 8MB
...this does not include the plpgsql.so library, which is shared by
all backends (which
use PL/pgSQL). I know that system will eventually swap out unused parts, but
then again, 40MB * number_of_connections is a bit wasteful. It seems to me that
both temp_buffers and work_mem don't affect plpgsql.so's allocations.
I wonder if this is something specific for my setup, or if not, can we
reduce memory
used a bit.
Regards,
Dawid
PS: I am just starting research now, I thought other people's view is valuable.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: qnex42@gmail.com
Subject: Re: PL/pgSQL memory consumption?
In-Reply-To: <758d5e7f0802220523x12a444ap679e51b990190ccc@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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