3 ms·
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 th
by ccmcarey 6y ago
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 6y agoWhere 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...