SQLSTATE 53200 FATAL Class 53: Insufficient Resources

out_of_memory could not create semaphores: No space left on device — 53200

PostgreSQL error “could not create semaphores: No space left on device — 53200” (SQLSTATE 53200): what it means, common causes, and how to fix it.

PG 9.6, 10, 11, 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed Jun 2026 Grounded in source

Diagnostic Queries

Symptoms

The server could not create the semaphores it needs at startup because the kernel ran out of semaphore space. PostgreSQL raises SQLSTATE 53200 (out_of_memory).

  • Semaphore allocation failed at startup.
  • Common with kernel SEMMNS/SEMMNI limits too low.
  • Note: this is not a disk-space issue despite the wording.

What the server log shows

FATAL:  could not create semaphores: No space left on device
DETAIL:  Failed system call was semget(5432001, 17, 03600).

Why PostgreSQL raises this — what the manual says

Section 18.4.1 Shared Memory and Semaphores:

“The maximum number of semaphores in the system is set by SEMMNS, which consequently must be at least as high as num_os_semaphores plus one extra for each set of 16 required semaphores (see the formula in Table 18.1).”

PostgreSQL allocates semaphore sets sized by max_connections and related settings. When the kernel’s semaphore limits are exhausted, semget() fails (misleadingly “No space left on device”) and the server reports 53200.

Common causes

  • Kernel semaphore limits (SEMMNS/SEMMNI) too low.
  • Other processes consuming the available semaphore sets.
  • max_connections set very high.

How to fix it

  1. Raise kernel semaphore limits per the OS tuning guide.
  2. Lower max_connections if appropriate.
  3. Free leaked IPC resources from crashed processes (ipcs/ipcrm).

Related & next steps

Reference: PostgreSQL 18 Section 19.4 “Managing Kernel Resources”.

Was this helpful?