Re: BUG #3680: memory leak when excuting a SQL "selectcount(id) from chinatelecom;" - Mailing list pgsql-bugs

From ssurui
Subject Re: BUG #3680: memory leak when excuting a SQL "selectcount(id) from chinatelecom;"
Date
Msg-id 00f701c81122$c7720dc0$2300a8c0@ssuruieda
Whole thread Raw
Responses Re: BUG #3680: memory leak when excuting a SQL "selectcount(id) from chinatelecom;"
List pgsql-bugs
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@mailst.xjtu.edu.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

pgsql-bugs by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: BUG #3680: memory leak when excuting a SQL "select count(id) from chinatelecom;"
Next
From: Douglas Toltzman
Date:
Subject: Re: BUG #3680: memory leak when excuting a SQL "selectcount(id) from chinatelecom;"