When THP always Undoes the Go Scavenger's Work
A fleet of Go services kept getting OOM-killed inside containers whose memory limits were generous — two to three times the live heap the runtime reported. We had GODEBUG=madvdontneed=1 set from years back, so I expected RSS to track the heap closely. Instead RSS climbed in a sawtooth that never came back down, while runtime.MemStats.HeapReleased insisted the memory had been handed back to the kernel. Both were telling the truth. The host had /sys/kernel/mm/transparent_hugepage/enabled set to always. ...