PRIMARY> show dbs;
admin 0.000GB
local 1.374GB
mydb 4.814GBPRIMARY> db.serverStatus().wiredTiger.cache['maximum bytes configured']
536870912
PRIMARY> db.serverStatus().mem
{
"bits" : 64,
"resident" : 12077,
"virtual" : 13658,
"supported" : true,
"mapped" : 0,
"mappedWithJournal" : 0
}PRIMARY> db.serverStatus().tcmalloc.generic
{
"current_allocated_bytes" : 620202152,
"heap_size" : NumberLong("12861964288")
}
PRIMARY> db.serverStatus().tcmalloc.tcmalloc.formattedString
------------------------------------------------
MALLOC: 622027856 ( 593.2 MiB) Bytes in use by application
MALLOC: + 11991433216 (11435.9 MiB) Bytes in page heap freelist
MALLOC: + 8663824 ( 8.3 MiB) Bytes in central cache freelist
MALLOC: + 1076992 ( 1.0 MiB) Bytes in transfer cache freelist
MALLOC: + 8042912 ( 7.7 MiB) Bytes in thread cache freelists
MALLOC: + 57303296 ( 54.6 MiB) Bytes in malloc metadata
MALLOC: ------------
MALLOC: = 12688548096 (12100.7 MiB) Actual memory used (physical + swap)
MALLOC: + 230719488 ( 220.0 MiB) Bytes released to OS (aka unmapped)
MALLOC: ------------
MALLOC: = 12919267584 (12320.8 MiB) Virtual address space used
MALLOC:
MALLOC: 20252 Spans in use
MALLOC: 120 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.Hi Pavel
It’s been some time since you posted this. Are you still having issues with high memory usage?
Please note that WiredTiger cache size is only part of MongoDB memory usage. Outside of WiredTiger cache, MongoDB uses memory for connections (~1 MB per connection), in-memory sorting, aggregation use, etc. So if you have a lot of active connections into the database, memory usage by the threads handling the connections could add up.
Having said that, could you please try upgrading to the latest in the 3.4 series (currently 3.4.14)? There were many improvements between 3.4.13 and 3.4.14, some of them involving memory usage. It is possible that upgrading may alleviate the memory pressure you’re seeing. Please see Upgrade to the Latest Revision of MongoDB for procedures.
Best regards
Kevin