
Major Bug in Glibc malloc Is Killing Applications with a Memory Limit - user5994461
https://thehftguy.com/2020/05/21/major-bug-in-glibc-is-killing-applications-with-a-memory-limit/
======
ccmcarey
As the article says, it's not exactly a bug.

> malloc() preallocates large chunks of memory, per thread

Memory that is preallocated this way counts towards the memory limit of a
process. Interesting and definitely not obvious, but it's not a bug.

~~~
user5994461
Where is the line between the bug and the feature?

When an app is using 1 GB of memory but malloc reserves 10 GB, is it a bug? If
it were the application doing it, it would be called a memory leak.

What when malloc reserves 50 GB slowly over one hour, is it enough to be a
bug? (it can certainly do that given the right environment)

Either way, it's causing issues in things that try to measure memory usage
like rlimit, schedulers, kubernetes, hadoop, etc...

