From: Scott Marlowe <smarlowe@g2switchworks.com>
To: Kathy Lo <kathy.lo.ky@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Memory Leakage Problem
Date: Tue, 06 Dec 2005 11:48:08 -0600
Message-ID: <1133891282.11803.7.camel@state.g2switchworks.com> (raw)
In-Reply-To: <c10e7feb0512060122u33a9c8eakb178525f3834b00@mail.gmail.com>
References: <c10e7feb0512060122u33a9c8eakb178525f3834b00@mail.gmail.com>
On Tue, 2005-12-06 at 03:22, Kathy Lo wrote:
> Hi,
>
> In this program, it will access this database server using simple and
> complex (joining tables) SQL Select statement and retrieve the matched
> rows. For each access, it will connect the database and disconnect it.
>
> I found that the memory of the databaser server nearly used up (total 2G RAM).
>
> After I stop the program, the used memory did not free.
Ummmm. What exactly do you mean? Can we see the output of top and / or
free? I'm guessing that what Tom said is right, you're just seeing a
normal state of how unix does things.
If your output of free looks like this:
-bash-2.05b$ free
total used free shared buffers cached
Mem:6096912 6069588 27324 0 260728 5547264
-/+ buffers/cache: 261596 5835316
Swap: 4192880 16320 4176560
Then that's normal.
That's the output of free on a machine with 6 gigs that runs a reporting
database. Note that while it shows almost ALL the memory as used, it is
being used by the kernel, which is a good thing. Note that 5547264 or
about 90% of memory is being used as kernel cache. That's a good thing.
Note you can also get yourself in trouble with top. It's not uncommon
for someone to see a bunch of postgres processes each eating up 50 or
more megs of ram, and panic and think that they're running out of
memory, when, in fact, 44 meg for each of those processes is shared, and
the real usage per backend is 6 megs or less.
Definitely grab yourself a good unix / linux sysadmin guide. The "in a
nutshell" books from O'Reilley (sp?) are a good starting point.
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: smarlowe@g2switchworks.com, kathy.lo.ky@gmail.com
Subject: Re: Memory Leakage Problem
In-Reply-To: <1133891282.11803.7.camel@state.g2switchworks.com>
* 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