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