[SERVER-11010] Building without NDEBUG defined causes tcmalloc to prefer the mmap allocator to sbrk allocator Created: 02/Oct/13 Updated: 11/Jul/16 Resolved: 03/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Participants: |
| Description |
|
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. |
| Comments |
| Comment by auto [ 03/Oct/13 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}Message: |
| Comment by auto [ 03/Oct/13 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}Message: |