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 CCBDE9DCC26 for ; Mon, 12 Dec 2005 16:48:49 -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 08952-01 for ; Mon, 12 Dec 2005 16:48:50 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.200]) by postgresql.org (Postfix) with ESMTP id 2F9929DCB57 for ; Mon, 12 Dec 2005 16:48:46 -0400 (AST) Received: by zproxy.gmail.com with SMTP id 16so846567nzp for ; Mon, 12 Dec 2005 12:48:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sH5d4dHbMayCstSE5M2VWsb5+UeZZMqYahRgId2D/aUFcoh5Yp3WW/crWlqJhgFtPtZVcUyVI05Tre+Zzvc4bIfJXaNBAbw0Qo+5DlsB7KYoxw6tRFg/i0f+bZDnSzlQk1P6CZ32PSBUUuKJ3SNrI5qKhjK+7agUpdOCmlKCneQ= Received: by 10.65.186.16 with SMTP id n16mr91852qbp; Mon, 12 Dec 2005 12:48:48 -0800 (PST) Received: by 10.65.235.2 with HTTP; Mon, 12 Dec 2005 12:48:48 -0800 (PST) Message-ID: Date: Mon, 12 Dec 2005 20:48:48 +0000 From: Mike Rylander To: Will Glynn Subject: Re: Memory Leakage Problem Cc: Tom Lane , pgsql general In-Reply-To: <439DDB49.3000905@freedomhealthcare.org> 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> <6353.1134016733@sss.pgh.pa.us> <439DDB49.3000905@freedomhealthcare.org> 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/593 X-Sequence-Number: 88156 On 12/12/05, Will Glynn wrote: > Mike Rylander wrote: > > >Right, I can definitely see that happening. Some backends are upwards > >of 200M, some are just a few since they haven't been touched yet. > > > > > >>Now, multiply that effect by N backends doing this at once, and you'll > >>have a very skewed view of what's happening in your system. > >> > > > >Absolutely ... > > > >>I'd trust the totals reported by free and dstat a lot more than summing > >>per-process numbers from ps or top. > >> > > > >And there's the part that's confusing me: the numbers for used memory > >produced by free and dstat, after subtracting the buffers/cache > >amounts, are /larger/ than those that ps and top report. (top says the > >same thing as ps, on the whole.) > > > > I'm seeing the same thing on one of our 8.1 servers. Summing RSS from > `ps` or RES from `top` accounts for about 1 GB, but `free` says: > > total used free shared buffers cached > Mem: 4060968 3870328 190640 0 14788 432048 > -/+ buffers/cache: 3423492 637476 > Swap: 2097144 175680 1921464 > > That's 3.4 GB/170 MB in RAM/swap, up from 2.7 GB/0 last Thursday, 2.2 > GB/0 last Monday, or 1.9 GB after a reboot ten days ago. Stopping > Postgres brings down the number, but not all the way -- it drops to > about 2.7 GB, even though the next most memory-intensive process is > `ntpd` at 5 MB. (Before Postgres starts, there's less than 30 MB of > stuff running.) The only way I've found to get this box back to normal > is to reboot it. > > >>>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 don't know of any reason to think that 8.1 would act differently from > >>older PG versions in this respect. > >> > > > >Neither can I, which is why I don't blame it. ;) I'm just reporting > >when/where I noticed the issue. > > > I can't offer any explanation for why this server is starting to swap -- > where'd the memory go? -- but I know it started after upgrading to > PostgreSQL 8.1. I'm not saying it's something in the PostgreSQL code, > but this server definitely didn't do this in the months under 7.4. > > Mike: is your system AMD64, by any chance? The above system is, as is > another similar story I heard. > It sure is. Gentoo with kernel version 2.6.12, built for x86_64.=20 Looks like we have a contender for the common factor. :) > --Will Glynn > Freedom Healthcare > -- Mike Rylander mrylander@gmail.com GPLS -- PINES Development Database Developer http://open-ils.org