X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 509929DCD16 for ; Wed, 7 Dec 2005 23:46:07 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 79101-09 for ; Wed, 7 Dec 2005 23:46:08 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.202]) by postgresql.org (Postfix) with ESMTP id 445CC9DCB56 for ; Wed, 7 Dec 2005 23:46:00 -0400 (AST) Received: by zproxy.gmail.com with SMTP id l8so524795nzf for ; Wed, 07 Dec 2005 19:46:04 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=US1gs2OfdyUAmPaqF2rpGBfKgztl9X33vmCaCx6SdrTX/X90clkeFiMaaQ2ai2y1JsaUIoYtL6TigLtODE96jyDRNrfPhcz2tXYn3wYzwaZyCzUJwRatx8im7RH+3cNT+UB94WCkATBEclwJCtHAH+bu1tMM77hQKE8uK0PpcnQ= Received: by 10.64.241.5 with SMTP id o5mr2505995qbh; Wed, 07 Dec 2005 19:46:02 -0800 (PST) Received: by 10.65.235.2 with HTTP; Wed, 7 Dec 2005 19:46:02 -0800 (PST) Message-ID: Date: Thu, 8 Dec 2005 03:46:02 +0000 From: Mike Rylander To: pgsql general Subject: Re: Memory Leakage Problem In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1133891282.11803.7.camel@state.g2switchworks.com> <1133991204.11803.43.camel@state.g2switchworks.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/419 X-Sequence-Number: 87982 On 12/8/05, Kathy Lo wrote: [snip] > When the user complains the system becomes very slow, I use top to > view the memory statistics. > In top, I cannot find any processes that use so many memory. I just > found that all the memory was used up and the Swap memory nearly used > up. Not to add fuel to the fire, but I'm seeing something similar to this on my 4xOpteron with 32GB of RAM running Pg 8.1RC1 on Linux (kernel 2.6.12). I don't see this happening on a similar box with 16GB of RAM running Pg 8.0.3. This is a lightly used box (until it goes into production), so it's not "out of memory", but the memory usage is climbing without any obvious culprit. To cut to the chase, here are some numbers for everyone to digest: total gnu ps resident size # ps ax -o rss|perl -e '$x +=3D $_ for (<>);print "$x\n";' 5810492 total gnu ps virual size # ps ax -o vsz|perl -e '$x +=3D $_ for (<>);print "$x\n";' 10585400 total gnu ps "if all pages were dirtied and swapped" size # ps ax -o size|perl -e '$x +=3D $_ for (<>);print "$x\n";' 1970952 ipcs -m # ipcs -m ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x0052e2c1 1802240 postgres 600 176054272 26 (that's the entire ipcs -m output) and the odd man out, free # free total used free shared buffers cached Mem: 32752268 22498448 10253820 0 329776 8289360 -/+ buffers/cache: 13879312 18872956 Swap: 31248712 136 31248576 I guess dstat is getting it's info from the same source as free, because: # dstat -m 1 ------memory-usage----- _used _buff _cach _free 13G 322M 8095M 9.8G Now, I'm not blaming Pg for the apparent discrepancy in calculated vs. reported-by-free memory usage, but I only noticed this after upgrading to 8.1. I'll collect any more info that anyone would like to see, just let me know. If anyone has any ideas on what is actually happening here I'd love to hear them! -- Mike Rylander mrylander@gmail.com GPLS -- PINES Development Database Developer http://open-ils.org