Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3D78E63288C for ; Wed, 15 Apr 2009 10:58:50 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 11617-02 for ; Wed, 15 Apr 2009 10:58:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 6135D62E7C2 for ; Wed, 15 Apr 2009 10:58:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n3FDwhtq009190; Wed, 15 Apr 2009 09:58:43 -0400 (EDT) To: Bryce Nesbitt cc: sql pgsql Subject: Re: Postgres process resident size does not drop after killing statement In-reply-to: <49E558B2.8000600@obviously.com> References: <49E558B2.8000600@obviously.com> Comments: In-reply-to Bryce Nesbitt message dated "Tue, 14 Apr 2009 20:46:58 -0700" Date: Wed, 15 Apr 2009 09:58:43 -0400 Message-ID: <9189.1239803923@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/79 X-Sequence-Number: 32425 Bryce Nesbitt 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