Re: Postgres process resident size does not drop after killing statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bryce Nesbitt <bryce2(at)obviously(dot)com>
Cc: sql pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Postgres process resident size does not drop after killing statement
Date: 2009-04-15 13:58:43
Message-ID: 9189.1239803923@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bryce Nesbitt <bryce2(at)obviously(dot)com> writes:
> Every so often our production Postgres 8.3 system will get statement
> that runs for a few hours, or a few days, or more, and needs to be
> killed dead. We kill it with pg_cancel_backend(), and cpu usage of the
> process immediately drops, and the process starts serving other
> statements. But the curious thing is the resident size does not drop.
> Is this normal?

Resident size as displayed by "top" is pretty misleading on many
systems. Typically, it counts whatever private memory the process
has plus as many pages of the shared memory area as the process has
actually touched in its lifespan. So the latter portion ramps up
from nil to approach the size of the shared memory block just as a
byproduct of normal operations. You did not say what your
shared_buffers setting is, but if it's a GB or two then I don't
find anything surprising in the numbers you show.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Browne 2009-04-15 16:43:07 Re: ENUM vs DOMAIN vs FKyed loookup table
Previous Message Jasen Betts 2009-04-15 12:57:20 Re: ENUM vs DOMAIN vs FKyed loookup table