Re: Memory Leakage Problem

From: Mike Rylander <mrylander(at)gmail(dot)com>
To: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Memory Leakage Problem
Date: 2005-12-08 03:46:02
Message-ID: b918cf3d0512071946m3cbfc630y679e0350a7f6b864@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

On 12/8/05, Kathy Lo <kathy(dot)lo(dot)ky(at)gmail(dot)com> 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 += $_ for (<>);print "$x\n";'
5810492

total gnu ps virual size
# ps ax -o vsz|perl -e '$x += $_ for (<>);print "$x\n";'
10585400

total gnu ps "if all pages were dirtied and swapped" size
# ps ax -o size|perl -e '$x += $_ 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(at)gmail(dot)com
GPLS -- PINES Development
Database Developer
http://open-ils.org

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Vadnais 2005-12-08 04:01:20 Re: deleting records is failing
Previous Message Michael Glaesemann 2005-12-08 03:21:23 Re: deleting records is failing

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-12-08 04:38:53 Re: Memory Leakage Problem
Previous Message Keith Worthington 2005-12-08 02:47:28 view of view