3 ms·
Well the example of the Linux kernel is an extremely bad one because it is absolutely stuffed full of memory management bugs on error paths. It will leak from `
by jeffbee 4y ago
Well the example of the Linux kernel is an extremely bad one because it is absolutely stuffed full of memory management bugs on error paths. It will leak from `goto` beyond the deallocation, or it will free memory that was never allocated if it branched over the allocation. When pressed to its limits, for example by running a container out of memory, the linux kernel memory management falls to pieces.
- greatgib 4y agoAnd yet, I can have years of server uptime, with high usage, but with constant kernel memory usage...
- jeffbee 4y agoSure, if you don't hit any of its error paths it is fairly happy. A really easy way to watch Linux go down in flames is to use kmem accounting (which is enabled by default) and a cgroup with a low memory limit (say, 48MB) and then inside that cgroup do something that exercises the kernel a lot, like walk a filesystem.