Error "could not reserve shared memory region ... error code 487" on Postgresql 17.5 in Windows
1
vote
1
answer
139
views
In PG 17.5 on Windows, I'm seeing errors in the log that look like:
2025-06-10 12:53:44.548 EDT LOG: could not reserve shared memory region (addr=0000022916760000) for child 00000000000014C4: error code 487
2025-06-10 13:09:44.667 EDT LOG: could not reserve shared memory region (addr=0000022916760000) for child 00000000000014A8: error code 487
2025-06-10 13:14:44.797 EDT LOG: could not reserve shared memory region (addr=0000022916760000) for child 00000000000014CC: error code 487
I was able to duplicate the issue fairly easily in two unconnected/unrelated environments. The issue appears to be triggered/exacerbated by higher settings of shared_buffers in postgresql.conf
Steps to replicate:
1. Install PG 17.5 on a windows machine from the EDB community release
2. In the default postgresql.conf that is created by the installer, change shared_buffers as follows: On an 8GB laptop (windows 11), I changed shared_buffers to 3GB. On a 768 GB Dell server (Windows Server 2019), changing shared_buffers to 256GB showed the error message quite often but with shared_buffers=128GB it took a couple of minutes for the message to appear.
3. Start the cluster with pg_ctl and watch the output. The higher the setting of shared_buffers, the more frequent the messages appear. On the 8 GB laptop, it took over 30 minutes to see the first message. On the Dell server I was getting those messages sometimes even before the server was ready to accept connections.
Notes:
1. the same hardware and Operating system runs PG 13.18 without those error messages.
2. There are no active connections or queries running during my testing
I set the logging to Debug5 and here are some associated messages. PID 19048 is the postmaster, not sure what PID 14992 is doing:
2025-06-10 10:11:47.402 EDT [] DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS
, xid/subid/cid: 0/1/0
2025-06-10 10:11:47.402 EDT [] DEBUG: CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRES
S, xid/subid/cid: 0/1/0
2025-06-10 10:11:47.402 EDT [] DEBUG: postmaster received pmsignal signal
2025-06-10 10:11:47.402 EDT [] DEBUG: mapped win32 error code 2 to 2
2025-06-10 10:11:47.403 EDT [] DEBUG: mapped win32 error code 2 to 2
2025-06-10 10:11:47.406 EDT [] LOG: could not reserve shared memory region (addr=000001A228F90000) for child 0000000000002168: error code 487
Asked by sevzas
(373 rep)
Jun 10, 2025, 06:06 PM
Last activity: Aug 4, 2025, 11:07 PM
Last activity: Aug 4, 2025, 11:07 PM