KB Article #193380

DATABASE: PostgreSQL Shared Memory Reservation Error on Windows

Problem

On Windows Server installations of SecureTransport, PostgreSQL may fail to start and the following messages may appear in the postgresql.log file:


LOG:  could not reserve shared memory region
(addr=1C0000000) for child 7655D98: error code 487


This error occurs when PostgreSQL is unable to reserve a shared memory segment during startup. On Windows Server 2022, this behavior can be triggered by the system's Exploit Protection settings, specifically when Randomize memory allocations (Bottom-up ASLR) is enforced for PostgreSQL binaries.


Resolution

To address the memory allocation failures, disable Bottom-up ASLR for the PostgreSQL executables. The following steps were performed on a Windows Server 2022 system:


1. Open Windows Settings → Update & Security → Windows Security.


2. Click App & browser control.


3. Select Exploit protection settings (at the bottom of the page).


4. Go to the Program settings tab.


5. Click Add program to customize → Add by program name.


6. Add the following executables:

pg_ctl.exe

postgres.exe


7. For each program:

Enable Override system settings.

Set Randomize memory allocations (Bottom-up ASLR) to Off.


8. Restart all SecureTransport services.


After applying these overrides, PostgreSQL should start normally without shared memory reservation errors.