Mismatch between size computed from pg_buffercahce Vs shared_buffers in postgresql?
Looks like MB vs MiB, ie decimal SI vs binary megabyte:

regress=&gt; SELECT round(25.17*1000*1000 / (1024*1024),1);
 round 
-------
  24.0
(1 row)


You've done your conversion into megabytes using decimal SI units (MB) not binary megabytes (MiB). Divide by 1024 not by 1000, or use pg_size_pretty:

regress=&gt; select pg_size_pretty( 3072 * 8192::bigint );
 pg_size_pretty 
----------------
 24 MB
(1 row)


Compare:

regress=&gt; select 
          pg_size_pretty( 3072 * 8192::bigint ),
          (3072::real * 8192)/(1024*1024) AS binaryMiB,
          (3072::real * 8192)/(1000*1000) AS decimalMB_SI;
 pg_size_pretty | binarymib | decimalmb_si 
----------------+-----------+--------------
 24 MB          |        24 |    25.165824
(1 row)


The GUC display code uses kiB / MiB / GiB too, but (IMO) mislabels it kB / MB / GB:

regress=&gt; SELECT 24*1024*1024;
 ?column? 
----------
 25165824
(1 row)

regress=&gt; SET work_mem = 25165824;
SET
regress=&gt; SHOW work_mem;
 work_mem 
----------
 24GB
(1 row)


(It's GB because work_mem is measured in kb not bytes; ignore the factor-of-1024 difference).