Mongo Memory Very Hight with Bytes in page heap freelist

I am using mongodb replicatset with the following configuration
Version : v4.0.28
oplogSizeMB: 614400
storageEngine : wiredTiger
I have a problem when mongodb uses too much Memory. I check tcmalloc and see the parameters as below.
Looks like Bytes in page heap freelist is too much.
I want to ask about how to solve this problem?

kymongodb:SECONDARY> db.serverStatus().tcmalloc.tcmalloc.formattedString
MALLOC:    98175938288 (93627.9 MiB) Bytes in use by application
MALLOC: + 136393015296 (130074.5 MiB) Bytes in page heap freelist
MALLOC: +   2417782424 ( 2305.8 MiB) Bytes in central cache freelist
MALLOC: +       293952 (    0.3 MiB) Bytes in transfer cache freelist
MALLOC: +     39110200 (   37.3 MiB) Bytes in thread cache freelists
MALLOC: +    992469248 (  946.5 MiB) Bytes in malloc metadata
MALLOC:   ------------
MALLOC: = 238018609408 (226992.2 MiB) Actual memory used (physical + swap)
MALLOC: +  52531675136 (50098.1 MiB) Bytes released to OS (aka unmapped)
MALLOC:   ------------
MALLOC: = 290550284544 (277090.3 MiB) Virtual address space used
MALLOC:        3141932              Spans in use
MALLOC:            102              Thread heaps in use
MALLOC:           4096              Tcmalloc page size

Please help?, it very important :((

Hey @Thanh_Nguyen_Van,

Welcome to the MongoDB Community!

The MongoDB 4.0 is no longer supported, and upgrading to a newer version is recommended. You can refer to the EOL Support Policies for more information on MongoDB versions and their support status.

Although, could you share some additional details in order to better understand your issue:

  • How do you know that it is actually consuming too much memory? Do you see any symptoms that make you believe it could be a reason?
  • Can you share more about the deployment configuration? Such as MongoDB version, hardware specs of servers, etc.
  • How are you running MongoDB - directly on servers, in Docker containers, Kubernetes? This could impact resource usage.
  • Could you share the output of the rs.status()?
  • Is this a sharded cluster or a single replica set? How many nodes are in the cluster?
  • Are all nodes in the replica set running on dedicated hardware as recommended as per Production Notes? Or are multiple mongod processes competing for resources on shared hosts?

Look forward to hearing from you.