1

In PG 17.5 on Windows, I'm seeing errors in the log that look like:

2025年06月10日 12:53:44.548 EDT [18612] LOG: could not reserve shared memory region (addr=0000022916760000) for child 00000000000014C4: error code 487
2025年06月10日 13:09:44.667 EDT [18612] LOG: could not reserve shared memory region (addr=0000022916760000) for child 00000000000014A8: error code 487
2025年06月10日 13:14:44.797 EDT [18612] 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 [14992] [] DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS
, xid/subid/cid: 0/1/0
2025年06月10日 10:11:47.402 EDT [14992] [] DEBUG: CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRES
S, xid/subid/cid: 0/1/0
2025年06月10日 10:11:47.402 EDT [19048] [] DEBUG: postmaster received pmsignal signal
2025年06月10日 10:11:47.402 EDT [19048] [] DEBUG: mapped win32 error code 2 to 2
2025年06月10日 10:11:47.403 EDT [19048] [] DEBUG: mapped win32 error code 2 to 2
2025年06月10日 10:11:47.406 EDT [19048] [] LOG: could not reserve shared memory region (addr=000001A228F90000) for child 0000000000002168: error code 487
asked Jun 10 at 18:06
12
  • 5
    What is your question? If you want to report a bug, here's how. Commented Jun 10 at 18:58
  • 2
    Same error seemes to happen using vesieon 15 or 16, see stackoverflow.com/a/67209054/724039 I would file a bug report Commented Jun 10 at 19:15
  • @Luuk I don't really agree that this is the same error as the question you cited. The thing they have in common is it's VM-related but the error message is different and the operating system is different (Windows vs Unix). However I will file a bug report. Commented Jun 11 at 10:46
  • Perhaps something else is gobbling memory on the machine. Commented Jun 11 at 10:58
  • 1
    I mean, sure, you can report a bug. I'd say these values are way too high. Commented Jun 11 at 11:33

1 Answer 1

0

After a lot of google searches, I have verified that to get rid of the "error code 487" errors on Windows, Address Space Layout Randomization (ASLR) needs to be disabled for pg_ctl.exe and postgres.exe .

How to disable ASLR on Windows Server 2019 for specific programs:

  1. Open Windows Settings
  2. Open "Update and Security"
  3. Open "Windows Security"
  4. Open "App & Browser Control"
  5. Now the menus on the left side include "Home", "Virus & Threat Protection", "Firewall & network protection", "App & browser control" and "Device Security". There is a link "Exploit protection settings" in the center of the window, near the bottom. Click on it.
  6. Now you see the "Exploit Protection" window with 2 tabs: System Settings and Program Settings. Click on "Program Settings".
  7. Click on "Add program to customize", "Add by program name". You will customize for two programs: "pg_ctl.exe" and "postgres.exe". The only necessary customization is to disable "Randomize memory allocations (Bottom-up ASLR)"
answered Jun 17 at 18:25
1

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.