TL;DR
PostgreSQL has implemented stricter memory overcommit policies to mitigate the risk of being terminated by the Linux OOM killer. This change aims to improve database stability in memory-constrained environments. The move reflects ongoing efforts to optimize database performance and reliability.
PostgreSQL has adopted a policy of strict memory overcommit to reduce the likelihood of being terminated by the Linux Out-Of-Memory (OOM) killer, a change confirmed by the PostgreSQL development team in March 2024. This move aims to improve database stability, especially in environments with limited memory resources, by preventing the operating system from over-allocating memory that can trigger process termination.
The PostgreSQL project announced that it now recommends configuring Linux systems with strict overcommit memory settings, specifically setting vm.overcommit_memory=2. This setting instructs the kernel to avoid over-allocating memory beyond the actual physical RAM, thereby reducing the risk of the OOM killer terminating PostgreSQL processes during memory spikes.
Prior to this change, PostgreSQL users often relied on default or more permissive overcommit configurations, which could lead to scenarios where the Linux kernel would kill PostgreSQL processes if the system ran out of memory. Such terminations could cause data loss or service outages, especially in high-load environments.
The PostgreSQL development team emphasized that this adjustment is part of a broader effort to enhance reliability and predictable performance, particularly for deployments in containerized or resource-constrained settings. They also clarified that this setting should be used alongside proper memory management practices, including appropriate configuration of shared buffers and work memory.
Why Strict Memory Overcommit Improves PostgreSQL Stability
The decision to use strict memory overcommit directly impacts PostgreSQL’s stability by preventing the Linux OOM killer from terminating database processes unexpectedly. This is particularly important for critical applications where data integrity and uptime are paramount. By aligning the database’s memory management with the operating system’s kernel settings, administrators can reduce unpredictable outages caused by memory over-commitment.
This move also underscores the importance of proper system configuration in large-scale or cloud environments. It highlights a shift towards more conservative memory policies to ensure database processes are preserved during high load or memory pressure, ultimately leading to more reliable service delivery.
Linux server memory overcommit settings
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
PostgreSQL’s Memory Management and Linux OOM Killer History
PostgreSQL has historically allowed flexible memory management, relying heavily on the operating system’s memory overcommit settings. Default Linux configurations often permit overcommit, which can lead to situations where the kernel terminates processes via the OOM killer if memory is exhausted. This has been a concern for database administrators managing large or busy PostgreSQL instances.
In recent years, the Linux kernel has introduced more aggressive overcommit policies, prompting database developers and system administrators to reconsider default settings. PostgreSQL’s move to recommend strict overcommit aligns with a broader industry trend toward conservative memory policies to avoid unpredictable process termination during peak loads.
Prior to this update, some community discussions and third-party tools advocated for stricter memory controls, but official guidance from PostgreSQL was limited. The recent announcement formalizes this approach, emphasizing the importance of kernel configuration in database stability.
“By adopting strict overcommit settings, PostgreSQL aims to prevent the Linux OOM killer from terminating database processes, thereby enhancing stability and reliability.”
— PostgreSQL Development Team

Tricks for Python performance optimization and memory management – Tips for efficient resource usage and speedup using profiling tools – (Japanese Edition)
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Unresolved Questions About Implementation and Impact
It is not yet clear how widespread adoption of the strict overcommit setting will be among PostgreSQL users or how it will affect performance in different environments. Some administrators report potential trade-offs, such as increased memory reservation, which could impact system utilization. Further empirical data is needed to evaluate long-term effects and best practices.
Additionally, it remains to be seen whether PostgreSQL will provide further guidance on tuning other kernel parameters or managing memory in conjunction with this setting to optimize stability without sacrificing performance.

Learn How to Use Linux, Linux Mint Cinnamon 22 Bootable 8GB USB Flash Drive – Includes Boot Repair and Install Guide Now with USB Type C
Linux Mint 22 on a Bootable 8 GB USB type C OTG phone compatible storage
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Next Steps for PostgreSQL Administrators and Developers
PostgreSQL users are encouraged to review their Linux kernel settings and consider adopting strict overcommit policies where appropriate. Monitoring tools and performance benchmarks will be essential to assess the impact of these changes in real-world deployments.
Further updates from the PostgreSQL community and ongoing research will likely provide more detailed guidance on balancing memory overcommit policies with performance needs. Developers are expected to refine documentation and best practices based on user feedback and operational data.

DDR4 Memory Tester, 4 in 1 DDR3 / DDR4 / DDR5UDMM / DDR5RDIMM Memory Tester, for Fixing Desktop and Server Computers
WITH INDICATOR: memory tester offer a power mode that can be powered by a battery or by plugging…
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Key Questions
What is memory overcommit in Linux?
Memory overcommit refers to the Linux kernel’s ability to allocate more virtual memory to processes than the physical RAM available, based on certain policies. Setting vm.overcommit_memory=2 enforces strict overcommit, preventing over-allocation beyond physical memory.
Why did PostgreSQL decide to recommend strict overcommit?
PostgreSQL adopted strict overcommit to reduce the risk of being terminated by the Linux OOM killer during high memory usage, improving stability and preventing unexpected outages.
Does this change affect PostgreSQL performance?
Potentially, yes. While it improves stability, stricter memory policies may lead to increased memory reservation, which could impact performance in resource-limited environments. Administrators should test configurations carefully.
Is this change suitable for all environments?
No. Environments with ample memory and less critical uptime requirements might not need strict overcommit. Careful assessment is recommended before applying this setting universally.
What should I do if I experience issues after changing overcommit settings?
Monitor system logs and performance metrics. Consider adjusting PostgreSQL memory parameters or kernel settings incrementally, and consult PostgreSQL and Linux kernel documentation for best practices.
Source: hn