Already checked many questions regarding this topic, and I believe it's a miss configuration on wiredTiger, actually not using it at all I believe.
This is the memory details on the primary:
------------------------------------------------
MALLOC: 9216501736 ( 8789.5 MiB) Bytes in use by application
MALLOC: + 295092224 ( 281.4 MiB) Bytes in page heap freelist
MALLOC: + 1027054880 ( 979.5 MiB) Bytes in central cache freelist
MALLOC: + 251104 ( 0.2 MiB) Bytes in transfer cache freelist
MALLOC: + 214021656 ( 204.1 MiB) Bytes in thread cache freelists
MALLOC: + 92561664 ( 88.3 MiB) Bytes in malloc metadata
MALLOC: ------------
MALLOC: = 10845483264 (10343.1 MiB) Actual memory used (physical + swap)
MALLOC: + 7447629824 ( 7102.6 MiB) Bytes released to OS (aka unmapped)
MALLOC: ------------
MALLOC: = 18293113088 (17445.7 MiB) Virtual address space used
MALLOC:
MALLOC: 1038376 Spans in use
MALLOC: 493 Thread heaps in use
MALLOC: 4096 Tcmalloc page size
------------------------------------------------
Call ReleaseFreeMemory() to release freelist memory to the OS (via madvise()).
Bytes released to the OS take up virtual address space but no physical memory.
This is the memory details on one of the secondaries:
------------------------------------------------
MALLOC: 9324505232 ( 8892.5 MiB) Bytes in use by application
MALLOC: + 565633024 ( 539.4 MiB) Bytes in page heap freelist
MALLOC: + 333445776 ( 318.0 MiB) Bytes in central cache freelist
MALLOC: + 7680 ( 0.0 MiB) Bytes in transfer cache freelist
MALLOC: + 641961696 ( 612.2 MiB) Bytes in thread cache freelists
MALLOC: + 64053504 ( 61.1 MiB) Bytes in malloc metadata
MALLOC: ------------
MALLOC: = 10929606912 (10423.3 MiB) Actual memory used (physical + swap)
MALLOC: + 59404288 ( 56.7 MiB) Bytes released to OS (aka unmapped)
MALLOC: ------------
MALLOC: = 10989011200 (10479.9 MiB) Virtual address space used
MALLOC:
MALLOC: 809348 Spans in use
MALLOC: 773 Thread heaps in use
MALLOC: 4096 Tcmalloc page size
------------------------------------------------
Call ReleaseFreeMemory() to release freelist memory to the OS (via madvise()).
Bytes released to the OS take up virtual address space but no physical memory.
Please correct me if I am wrong, but it seems that there is 7GB of memory in cache, that could be cleaned, correct?
The mongodb server version currently being used is 4.0.6.
And this is the section on mongod.conf related to the storage:
storage:
dbPath: /var/lib/mongodb
There is no configuration for the maximum GB used for wiredTiger, so I believe it will use 50% of (RAM - 1 GB) for that, right? The RAM of the machine is 16GB. So that would be 7.5GB for cache, maybe its too much, I don't know, any insights on this issue?
Every few days there is the need of restarting the nodes, and it would be great to find a fix for this.
Thank you.