Ok, we are 99% sure as for what is the reason for this situation. Let's say
we have a 1 GB of free memory. Any process (especially postgres, as it is
dedicated server) wants to allocate little more. Kernel has to look through
cached memory to determine which cache pages can be dropped and allocated
as user memory. If the server is idle (almost no queries) allocating huge
amounts of memory is almost invisible, but under production load (about
100-200 transactions per second) system halts for a while, to drop some of
cache pages.
We consider setting kernel value extra_free_kbytes to some reasonably high
value to check if it helps keeping free memory at certain level.
It seems that it's not a PostgreSQL bug.
Can anyone try to confirm this?
--
Regards
Andrzej Krawiec