On 8/12/09 9:44 PM, "Alex" <alex@xxxxxxxxxx> wrote: > The writer process seems to be using inordinate amounts of memory: > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ > COMMAND > 11088 postgres 13 -2 3217m 2.9g 2.9g S 0 38.7 0:10.46 postgres: > writer process > 20190 postgres 13 -2 3219m 71m 68m S 0 0.9 0:52.48 postgres: > cribq cribq [local] idle > > I am writing moderately large (~3k) records to my database a few times > a second. Even when I stop doing that, the process continues to take > up all of that memory. > > Am I reading this right? Why is it using so much memory? > It is exclusively using the difference between the RES and SHR columns. So ... Less than ~50MB and likely much less than that (2.9g - 2.9g with rounding error). SHR is the shared memory the process has touched, and is shared amongst all postgres processes. Typically, this maxes out at the value of your shared_buffers setting. Based on the above, I'd wager your shared_buffers setting is 3000MB. If your writer process or any other process has a value for (RES - SHR) that is very large, then be concerned. For example, the second postgres process in the above top output is using about 3MB exclusively, but has touched about 68MB of the shared space, and so it shows up as 68 + 3 = 71m in the RES column. 3MB is not much so this is not a concern. > > -- > Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance > -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance