Re: BUG #3680: memory leak when excuting a SQL "selectcount(id) from chinatelecom; "

From: Douglas Toltzman <doug(at)oakstreetsoftware(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3680: memory leak when excuting a SQL "selectcount(id) from chinatelecom; "
Date: 2007-10-18 01:17:55
Message-ID: 5A75E109-39A6-4A7E-AD84-7237679FBCAF@oakstreetsoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Actually, the reason for utilizing all available RAM is to improve
efficiency. There is no cost to leaving things in core, in case they
will can be re-used. It takes virtually no time to make pages
available when they are needed. The only cost is in managing
utilization maps, but accessing the hard drive takes milliseconds
where getting something from RAM takes nanoseconds. It's really an
operating system thing, not a Postgres issue.

On Oct 17, 2007, at 9:04 PM, ssurui wrote:

> Thank you for the explanations.
>
> My program is running 4 months, it has never exit because of the
> shortage of memory. But the ‘free’ memory (observing by top
> command) is kept on about 20MB (The database server has 2GB DDR RAM).
>
>
>
> According to you explanations, when I “malloc” a buffer of 30MB,
> the cache will be reduced to give me 30MB. I think it is true. So
> another question is whether the efficiency of program is affected
> to go down?
>
>
> ssurui(at)mailst(dot)xjtu(dot)edu(dot)cn
>
>
>
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> --
>
> I think the one thing everyone knows as a fact is that the memory
> did not vanish. Your latest message gives us a clue that what
> interests you is why free (unused, idle, not giving you any
> benefit) memory went down. If that is the question, it is because
> PostgreSQL goes through the OS file systems, so RAM which is
> serving no other purpose will automatically be used to cache data.
> If you need memory for something else, the cache will be reduced to
> compensate.
>
>
>
> -Kevin
>
>
Douglas Toltzman
doug(at)oakstreetsoftware(dot)com
(910) 526-5938

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message ITAGAKI Takahiro 2007-10-18 03:21:13 Re: BUG #3681: fillers are NULL in pgbench
Previous Message ssurui 2007-10-18 01:04:05 Re: BUG #3680: memory leak when excuting a SQL "selectcount(id) from chinatelecom; "