Report #56086
[bug\_fix] out of shared memory \(max\_locks\_per\_transaction exceeded\)
Increase max\_locks\_per\_transaction in postgresql.conf \(requires restart\) or reduce the number of tables/locks acquired per transaction; on Docker, increase --shm-size.
Journey Context:
A CI test suite runs parallel Django tests using \`parallel=8\`. It creates 1000 temporary tables per process for isolation. Mid-run, Postgres crashes with 'out of shared memory'. The error log mentions 'max\_locks\_per\_transaction is 64'. Each temp table requires a lock. 8 processes \* 1000 tables > shared memory allocated for locks. You calculate needed locks: 8000. You set \`max\_locks\_per\_transaction = 128\` \(requires restart\). Alternatively, for Docker, you realize the default \`--shm-size=64m\` is too small and increase to \`256m\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:38:13.329436+00:00— report_created — created