Info
The changes described in SERVER-20306 eliminated a common source of memory fragmentation, but it can still occur for other reasons. Here's an example from a node undergoing initial sync:
Over time
allocated memory never exceeds 8 GB
but heap size and resident memory reach nearly 14 GB
this is due to an accumulation of pageheap_free_bytes
A common cause of this is a shifting distribution of allocated memory sizes, which leaves free pages dedicated to one size of buffer unable to be used for new memory requests because they are for a different size buffer.
Setting TCMALLOC_AGGRESSIVE_DECOMMIT can address this issue by causing tcmalloc to aggressively return the free pages to the o/s where they can then be re-used by tcmalloc to satisfy new memory requests. However can have an unacceptable negative performance impact. Is there a tweak to tcmalloc that can give us better behavior for workloads like this?
Top User Comments
JIRAUSER1263881 commented on Thu, 9 Dec 2021 06:40:40 +0000:
Hi,
My name is Eran Davidi and my company is a customer of MongoDB atlas.
I wanted to ask if there is an estimation on when this bug will be fixed since I see it is very old.
We are using Mongo 4.4.10 and suffering from this issue.
Best Regards,
Eran Davidi
JIRAUSER1256988 commented on Thu, 26 Aug 2021 13:36:44 +0000:
I think the ultimate solution should be to migrate to the new per-cpu TCmalloc. I commented why I think it will be faster in the comments for PERF-2106 "Performance support for TCMalloc Evaluation". Using other malloc solutions should be considered as well, however new TCmalloc might still be the best.
ian@10gen.com commented on Fri, 16 Mar 2018 14:25:03 +0000:
Reviewed this in needs triage but the high cost:benefit puts this outside of the Storage team's top 15 at the moment. So putting on backlog and will re-appraise later.
CC asya
bruce.lucas@10gen.com commented on Wed, 14 Feb 2018 14:24:14 +0000:
Verified that the same behavior is still observed in 3.6.2:
Steps to Reproduce
david.daly - Handing over to you per e-mail discussion.