Get the latest tech news

Vm.overcommit_memory=2 is the right setting for servers


The Linux kernel has a feature where you can tune the behavior of memory allocations: the vm.overcommit_memory sysctl. When overcommit is enabled (sadly, this is the default), the kernel will typically return a mapping when brk(2) or mmap(2) is called to increase a program’s heap size, regardless of whether or not memory is available. Sounds good, right? Not really. While overcommit is convenient for application developers, it fundamentally changes the contract of memory allocation: a successful allocation no longer represents an atomic acquisition of a real resource.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of servers

servers

Photo of right setting

right setting

Related news:

News photo

Hackers exploit unpatched Gogs zero-day to breach 700 servers

News photo

HPE’s AI Servers Ready as Soon Data Centers Are, Says CEO

News photo

Critical React, Next.js flaw lets hackers execute code on servers