From: Craig Ringer <craig@2ndQuadrant.com>
To: Wu Ming <rdyf4ever@gmail.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: PostreSQL v9.2 uses a lot of memory in Windows XP
Date: Wed, 14 Nov 2012 07:07:00 +0800
Message-ID: <50A2D294.5090702@2ndQuadrant.com> (raw)
In-Reply-To: <CAE5Kd6JRVm0w+9LsLYwNQdYovDx4vFJP2C4scPGOa34ZVJRSQA@mail.gmail.com>
References: <CAE5Kd6KYScFFupxtXBVvtXdo4mDykkmKnogs8E5AB7Xe+Kwykg@mail.gmail.com>
<50A1AB86.8020200@2ndQuadrant.com>
<CAE5Kd6JRVm0w+9LsLYwNQdYovDx4vFJP2C4scPGOa34ZVJRSQA@mail.gmail.com>
Please reply to the list, not directly to me. Comments follow in-line.
On 11/13/2012 11:37 PM, Wu Ming wrote:
> Hi,
>
> What column in Process Explorer to determine memory usage? Currently I
> thought "Working Set" is the correct one.
As I said, it just isn't that simple when shared memory is involved. A
rough measure for PostgreSQL is the "virtual size" of one of the
processes, plus the working sets of all the others. Alternately, you can
reasonably estimate the memory consumption by adding all the working
sets and then adding the value of shared_buffers to that - this will
under-estimate usage slightly because PostgreSQL also uses shared memory
for other things, but not tons of it in a normal configuration.
> The 'lagging' is like when you try to alt+tab or activating/focusing
> other application window, or changing tab in browser, it goes slow or
> lagged in its UI loading.
Sure, that's what you see, but you should really be looking at the
numbers. Swap in and out bytes, memory usage, etc. In Windows 7 or
Win2k8 Server you'd use the Performance Monitor for that; I don't
remember off the top of my head where to look in XP.
> My firefox has many tabs opened (around 30 tabs) and eclipse is well
> known as its high memory usage.
On a 2GB machine? Yup, that'll do it.
You've shown a screenshot that suggests that Pg is using relatively
little RAM, and you're running two known memory pigs. I'd say your
problem has nothing to do with PostgreSQL.
> Then usually I also opened opera and
> chrome with ~10-20 tabs opened.
Time to buy more RAM.
> I saw that chrome also spawned many
> process (I had 4 tabs opened, but it shows 8 child process). They
> might be the big process that probably is the main cause of the
> lagging.
It's going to be everything adding up. Chrome, Eclipse, Firefox, all
fighting for RAM.
BTW, chrome uses a multi-process architecture like PostgreSQL, but
unlike PostgreSQL it does not use shared memory, so you can tell how
much RAM Chrome is using very easily by adding up the working sets.
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
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-performance@postgresql.org
Cc: craig@2ndQuadrant.com, rdyf4ever@gmail.com
Subject: Re: PostreSQL v9.2 uses a lot of memory in Windows XP
In-Reply-To: <50A2D294.5090702@2ndQuadrant.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