I have a rather naive question regarding the size of shared_buffers computed from pg_buffercache and the shared_buffers size mentioned in postgresql.conf. Based on my understanding pg_buffercache shows the state of all the buffers in shared_buffers. Thus, size of shared buffers = Number of entries in pg_buffercache * Size of one page (8192 bytes). When I run this on my system :
test=# select count(1) from pg_buffercache; count ------- 3072 (1 row) test=# show shared_buffers; shared_buffers ---------------- 24MB (1 row)
Calculated size of shared buffers = 3072 * 8192 ~= 25.17 MB. Actual size of shared buffers = 24 MB.
Why is there a difference between the computed size of shared buffers and the actual size of shared buffers ? Let me know if my understanding is wrong.