pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Will Glynn <wglynn@freedomhealthcare.org>
To: Mike Rylander <mrylander@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql general <pgsql-general@postgresql.org>
Subject: Re: Memory Leakage Problem
Date: Mon, 12 Dec 2005 15:19:21 -0500
Message-ID: <439DDB49.3000905@freedomhealthcare.org> (raw)
In-Reply-To: <b918cf3d0512080600q5c841fc8lecd96c3bad66cfdc@mail.gmail.com>
References: <c10e7feb0512060122u33a9c8eakb178525f3834b00@mail.gmail.com>
	<1133891282.11803.7.camel@state.g2switchworks.com>
	<c10e7feb0512061816o21305ac7n576694f2624dc6ed@mail.gmail.com>
	<1133991204.11803.43.camel@state.g2switchworks.com>
	<c10e7feb0512071825h30c93c00kdf5ea2a11e613f0b@mail.gmail.com>
	<b918cf3d0512071946m3cbfc630y679e0350a7f6b864@mail.gmail.com>
	<6353.1134016733@sss.pgh.pa.us>
	<b918cf3d0512080600q5c841fc8lecd96c3bad66cfdc@mail.gmail.com>

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.

--Will Glynn
Freedom Healthcare



view thread (22+ messages)  latest in thread

Message-ID: <439DDB49.3000905@freedomhealthcare.org>
Permalink:  ../439DDB49.3000905@freedomhealthcare.org/
Also on:    postgresql.org/message-id/439DDB49.3000905@freedomhealthcare.org

 · 

reply

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: wglynn@freedomhealthcare.org, mrylander@gmail.com, tgl@sss.pgh.pa.us, pgsql-general@postgresql.org
  Subject: Re: Memory Leakage Problem
  In-Reply-To: <439DDB49.3000905@freedomhealthcare.org>

* 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