frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

PostgreSQL and the OOM Killer: Why We Use Strict Memory Overcommit

https://www.ubicloud.com/blog/postgresql-and-the-oom-killer-why-we-use-strict-memory-overcommit
40•furkansahin•1h ago

Comments

Bender•1h ago
They allude to this in the article but I would emphasize caution when using mode 2 especially if one has already adjusted overcommit ratios as one can prevent forks. Test this in a QA/Perf environment first, also testing the restart of all applications. Load test and do full QA tests before deploying to Production and even then when deploying to production I would just dynamically change the setting via app deployment scripts until confidence is high instead of putting it in the sysctl config files.

I've gone through this exercise in the past on much older kernels which they cover as well and just me personally I ran into less issues by leaving overcommit to 0 and just dropping the overcommit ratio to 0 and setting the oom_score_adj for programs as high as 1000 if I wanted vmscan to leave them alone and of course using the Redhat formulas for setting vm.min_free_kbytes, vm.admin_reserve_kbytes, vm.user_reserve_kbytes. And of course be vigilant in disallowing app owners from using every last bit of memory.

szmarczak•57m ago
I have disabled overcommit both on Windows and on Linux. I hate having random programs being killed.

Unfortunately, many programs commit 2x memory than they actually use. Often I see ~32GB committed and ~16GB resident.

sterwill•17m ago
Does this result in programs more frequently erroring/crashing because they can't allocate? I don't know how well many of the programs I frequently use on my desktop (Firefox, GNOME desktop, JVM + IntelliJ, Slack, etc.) handle allocation failures. I'm not sure they would do much better than crash, but I know the default OOM killer settings work well for me. About once a year a real runaway process (usually a throwaway program I'm working on) gets OOM-killed, and that's fine with me.
leononame•45m ago
This has bitten me multiple times. The problem I have is that at work we deploy the application (written in Go) and PostgreSQL on the same machine. The backend app allocates a lot of virtual memory, and initially we had overcommit to 0 (heuristic). This caused crashes on big queries in PostgreSQL and we set it to 2. The whole system became a bit unstable because the backend would still allocate a lot of virtual memory and at some point we ran into errors when allocating.

For now, we have overcommit_ratio set to a value that is stable from experience, but there really seems to be no silver lining. Go is very happy to allocate a lot of virtual memory, but so are most managed languages. The best solution would probably be to host the backend and the database on separate servers.

hilariously•37m ago
Yes, it would. Basically every serious database tries to allocate everything and more - back in the day we'd just allocate VMs on the machine even with the overhead because knowing it cannot leave its constraints and would work within them was worth the cost.
ozgune•37m ago
(Ozgun from Ubicloud)

I agree with the blog post's technical contents, but I feel we came across too strong in the title. For Ubicloud as a managed Postgres provider, we use strict memory overcommit. Our experience with operating Postgres at scale taught us that it's better to enable this than going with the defaults.

However, I can see many other scenarios, where using strict memory overcommit would have unanticipated side-effects. That's why Linux doesn't go with strict memory commit as its default.

furkansahin•17m ago
(Furkan, submitter) Hmm, I haven’t thought about that. I updated the title to better reflect Ubicloud Postgres' position.
otterley•32m ago
I think this is also a good lesson on why it's best to isolate mission-critical services like databases on their own compute nodes.
adamors•7m ago
I read this article about 3 weeks ago when this bit me. Really great write-up, some tricky details.

Half-Baked Product

https://weli.dev/blog/half-baked-product/
689•weli•6h ago•194 comments

PostgreSQL and the OOM Killer: Why We Use Strict Memory Overcommit

https://www.ubicloud.com/blog/postgresql-and-the-oom-killer-why-we-use-strict-memory-overcommit
42•furkansahin•1h ago•9 comments

Valve open source the Steam Machine e-ink screen so you can make your own

https://www.gamingonlinux.com/2026/07/valve-open-source-the-steam-machine-e-ink-screen-so-you-can...
119•ahlCVA•1h ago•16 comments

Wordgard: The new in-browser rich-text editor from the creator of ProseMirror

https://wordgard.net/
102•indy•5h ago•51 comments

Please stop the AI confidence theater

https://www.elenaverna.com/p/please-stop-the-ai-confidence-theater
130•skadamat•1h ago•78 comments

Right to Local Intelligence

https://righttointelligence.org/
370•thoughtpeddler•14h ago•130 comments

CarPlay Is Additive

https://www.caseyliss.com/2026/7/2/carplay-is-additive-you-dolts
431•sprawl_•13h ago•584 comments

The Fall and Rise of Screwworm

https://www.construction-physics.com/p/the-fall-and-rise-of-screwworm
11•crescit_eundo•1h ago•5 comments

The Safari MCP server for web developers

https://webkit.org/blog/18136/introducing-the-safari-mcp-server-for-web-developers/
164•coloneltcb•13h ago•47 comments

How working with a blind client revealed invisible accessibility gaps

https://iinteractive.com/resources/blog/read-only
49•fortyseven•3d ago•35 comments

Since Linux 6.9, LUKS suspend stopped wiping disk-encryption keys from memory

https://mathstodon.xyz/@iblech/116769502749142438
506•IngoBlechschmid•23h ago•216 comments

crustc: entirety of `rustc`, translated to C

https://github.com/FractalFir/crustc
334•Philpax•15h ago•66 comments

Commodore 64 Basic for PostgreSQL

https://thombrown.blogspot.com/2026/07/load-plcbmbasic81-commodore-64-basic.html
33•hans_castorp•5h ago•6 comments

Show HN: Pieces – Social network for people

https://try.piecesof.me/
46•domo__knows•1d ago•47 comments

Podman v6.0.0

https://blog.podman.io/2026/07/introducing-podman-v6-0-0/
592•soheilpro•1d ago•234 comments

Quake in 13 Kilobytes (2021)

https://js13kgames.com/games/q1k3
85•mortenjorck•6d ago•10 comments

Reality has a surprising amount of detail (2017)

https://johnsalvatier.org/blog/2017/reality-has-a-surprising-amount-of-detail
319•vinhnx•5d ago•117 comments

Gemini Code Assist will be shut down on July 17

https://docs.cloud.google.com/gemini/docs/code-review/review-repo-code
25•ushakov•1h ago•11 comments

Local Reasoning for Global Properties

https://tratt.net/laurie/blog/2026/local_reasoning_for_global_properties.html
13•mpweiher•2d ago•2 comments

Hackers shoveled snow for company, were rewarded with network admin access

https://www.theregister.com/security/2026/07/02/hackers-shoveled-snow-for-company-were-rewarded-w...
27•ike_usawa•1h ago•2 comments

Zuckerberg 'Admits' Meta's Layoffs Were Ineffective

https://eshumarneedi.com/2026/07/03/zuckerberg-admits-metas-layoffs-were.html
115•ExMachina73•1h ago•118 comments

Alibaba to ban Claude Code in workplace over alleged backdoor risks, source says

https://www.reuters.com/world/china/alibaba-ban-claude-code-workplace-over-alleged-backdoor-risks...
222•nsoonhui•6h ago•174 comments

Immich 3.0

https://github.com/immich-app/immich/discussions/29439
523•hashier•1d ago•257 comments

Exapunks (2018)

https://www.zachtronics.com/exapunks/
311•yu3zhou4•20h ago•107 comments

Underwater suit-wearing cyborg insect capable of diving and terra-aqua travel

https://www.nature.com/articles/s41467-026-74235-1
73•gscott•3d ago•28 comments

Virginia bans sale of precise geolocation data

https://www.hunton.com/privacy-and-cybersecurity-law-blog/virginia-bans-sale-of-geolocation-data
902•toomuchtodo•17h ago•134 comments

Q&A with Micron's VP and GM of Memory

https://morethanmoore.substack.com/p/q-and-a-with-microns-vp-and-gm-of
17•zdw•2d ago•11 comments

The Beauty of Tautologies

https://scottsumner.substack.com/p/the-beauty-of-tautologies
12•surprisetalk•2d ago•9 comments

Show HN: OM Core – multidimensional models without spreadsheet cell formulas

https://github.com/cloudcell/om-core
4•cloudcell•2d ago•1 comments

The short leash AI coding method for beating Fable

https://blog.okturtles.org/2026/07/short-leash-ai-method/
167•Riseed•19h ago•208 comments