Thread: Postgresql Memory Problem

Postgresql Memory Problem

From
dotaku
Date:
Hi all..

i've got a problem with the memory that postgresql 7.3.2 used in RedHat 9.
When the memory usage reached 80% or more of the total memory in the
system..
the memory just keep stuck there..The thing did not reduce bt itself...

Then i decided to stop the postgresql service. But ...the memory that
postgresql used still stuck...I used top to check the memory...

The only way to solved it now...is via rebooting the machine..But that
is ridiculous..
Need Help....maybe i miss configured the postgresql.conf.

But give me something to tinker with..

thank in advanced...

--azman--



Re: Postgresql Memory Problem

From
Mailing List
Date:
> i've got a problem with the memory that postgresql 7.3.2 used in RedHat 9.
> When the memory usage reached 80% or more of the total memory in the
> system..
> the memory just keep stuck there..The thing did not reduce bt itself...
>
> Then i decided to stop the postgresql service. But ...the memory that
> postgresql used still stuck...I used top to check the memory...

It's a Linux thing, probably. The mem is still allocated as buffers.
When somebody else claims it, it will get it. No need to worry...

Bye, Chris.



Re: Postgresql Memory Problem

From
"scott.marlowe"
Date:
On Mon, 20 Oct 2003, dotaku wrote:

> Hi all..
>
> i've got a problem with the memory that postgresql 7.3.2 used in RedHat 9.
> When the memory usage reached 80% or more of the total memory in the
> system..
> the memory just keep stuck there..The thing did not reduce bt itself...
>
> Then i decided to stop the postgresql service. But ...the memory that
> postgresql used still stuck...I used top to check the memory...
>
> The only way to solved it now...is via rebooting the machine..But that
> is ridiculous..
> Need Help....maybe i miss configured the postgresql.conf.
>
> But give me something to tinker with..

Are you talking about something like this:

Mem:  1543980K av, 1538248K used,    5732K free,  266768K shrd,   36064K buff
Swap: 2048208K av,  194532K used, 1853676K free                  802612K cached

Where I'm only showing 5732k free, but 802612k cached?  That's normal.
The linux kernel is just using the spare memory for file caching until
something tries to allocate a big chunk of memory, then it will give it
back.  That's normal operation.

Or is it something else?


Re: Postgresql Memory Problem

From
dotaku
Date:
scott.marlowe wrote:

>On Mon, 20 Oct 2003, dotaku wrote:
>
>
>
>>Hi all..
>>
>>i've got a problem with the memory that postgresql 7.3.2 used in RedHat 9.
>>When the memory usage reached 80% or more of the total memory in the
>>system..
>>the memory just keep stuck there..The thing did not reduce bt itself...
>>
>>Then i decided to stop the postgresql service. But ...the memory that
>>postgresql used still stuck...I used top to check the memory...
>>
>>The only way to solved it now...is via rebooting the machine..But that
>>is ridiculous..
>>Need Help....maybe i miss configured the postgresql.conf.
>>
>>But give me something to tinker with..
>>
>>
>
>Are you talking about something like this:
>
>Mem:  1543980K av, 1538248K used,    5732K free,  266768K shrd,   36064K buff
>Swap: 2048208K av,  194532K used, 1853676K free                  802612K cached
>
>Where I'm only showing 5732k free, but 802612k cached?  That's normal.
>The linux kernel is just using the spare memory for file caching until
>something tries to allocate a big chunk of memory, then it will give it
>back.  That's normal operation.
>
>Or is it something else?
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 7: don't forget to increase your free space map settings
>
>
>
Thanks...but can I flush a postgreql server unused memory after stopping
it. The problem that i had is that, even after stopping all postgresql
services...the used memory is still more than 80% of the total RAM..

any idea how to flush it. I've read somewhere about kflushd and
bdflushd. How to used it...Both are kernel related. Is there any user
space program that can kick it.

--azman---



Re: Postgresql Memory Problem

From
"Soeren Laursen"
Date:
> Thanks...but can I flush a postgreql server unused memory after stopping
> it. The problem that i had is that, even after stopping all postgresql
> services...the used memory is still more than 80% of the total RAM..
>
> any idea how to flush it. I've read somewhere about kflushd and
> bdflushd. How to used it...Both are kernel related. Is there any user
> space program that can kick it.
No need for it as Scott wrote!

The kernel will claim it when it needs it.

Søren,

Re: Postgresql Memory Problem

From
Andrew Sullivan
Date:
On Tue, Oct 21, 2003 at 09:31:49PM +0800, dotaku wrote:

> Thanks...but can I flush a postgreql server unused memory after stopping
> it. The problem that i had is that, even after stopping all postgresql
> services...the used memory is still more than 80% of the total RAM..

It sounds like you're worrying about something that you need not
worry about.  It is totally normal for your OS to "use up" memory
that is not otherwise used.  Why have it if it's not going to be
used?

A

----
Andrew Sullivan                         204-4141 Yonge Street
Afilias Canada                        Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110


Re: Postgresql Memory Problem

From
"scott.marlowe"
Date:
On Tue, 21 Oct 2003, dotaku wrote:

> scott.marlowe wrote:
>
> >On Mon, 20 Oct 2003, dotaku wrote:
> >
> >
> >
> >>Hi all..
> >>
> >>i've got a problem with the memory that postgresql 7.3.2 used in RedHat 9.
> >>When the memory usage reached 80% or more of the total memory in the
> >>system..
> >>the memory just keep stuck there..The thing did not reduce bt itself...
> >>
> >>Then i decided to stop the postgresql service. But ...the memory that
> >>postgresql used still stuck...I used top to check the memory...
> >>
> >>The only way to solved it now...is via rebooting the machine..But that
> >>is ridiculous..
> >>Need Help....maybe i miss configured the postgresql.conf.
> >>
> >>But give me something to tinker with..
> >>
> >>
> >
> >Are you talking about something like this:
> >
> >Mem:  1543980K av, 1538248K used,    5732K free,  266768K shrd,   36064K buff
> >Swap: 2048208K av,  194532K used, 1853676K free                  802612K cached
> >
> >Where I'm only showing 5732k free, but 802612k cached?  That's normal.
> >The linux kernel is just using the spare memory for file caching until
> >something tries to allocate a big chunk of memory, then it will give it
> >back.  That's normal operation.
> >
> >Or is it something else?
> >
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 7: don't forget to increase your free space map settings
> >
> >
> >
> Thanks...but can I flush a postgreql server unused memory after stopping
> it. The problem that i had is that, even after stopping all postgresql
> services...the used memory is still more than 80% of the total RAM..
>
> any idea how to flush it. I've read somewhere about kflushd and
> bdflushd. How to used it...Both are kernel related. Is there any user
> space program that can kick it.

I repeat my question, does your memory look like what I showed?  If so,
then why would you want to flush the memory?  What good is memory doing
you if it's sitting there empty?  None.  By being used as cache by the OS,
the spare memory is getting something done, i.e. speeding up your system.
should a program need memory, the cache will be dumped and the memory made
available automatically.  So, if your system DOES look like the one I
showed top for, then there is NO PROBLEM and you need to find something
else to worry about.

If memory is still showing as belonging to postgresql processes, that's a
different matter entirely.

So, which is it?  Does the machine have a top output that looks like mine
(please, feel free to share yours, it's quite helpful to us to see what
your machine looks like.) or does it have some other issue?