-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
We don't currently set NDEBUG for our --dbg=off builds, instead relying on _DEBUG.
The only standard mandated behavior for NDEBUG is that it alters the semantics of 'assert'. And we don't use bare asserts in the mongodb source.
However, the code in third_party may interpret NDEBUG, and, in particular, tcmalloc cares.
The consequence is that kDebugMode becomes true, which is used:
to determine whether to prefer the mmap or sbrk allocator.
Since we don't define NDEBUG, tcmalloc ends up preferring the mmap allocator, which is not its intended production deployment configuration.