MongoDB shell version: 3.2.0 using RAM memory and there is no process doing anything

38 views
Skip to first unread message

Eric Echeverri

unread,
Aug 10, 2017, 1:54:54 PM8/10/17
to mongodb-user

    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                       

                                                                                        

 635743 mongod    20   0  252g 251g 5880 S  0.3 69.5   4668:15 mongod 



mongod process keeps using huge amount of memory even though client threads that do some processing are done hours ago. Yet mongo keeps using RAM memory of about 70%. Any ideas why this is happenning ?



Thanks

  

Rhys Campbell

unread,
Aug 13, 2017, 2:18:27 PM8/13/17
to mongodb-user
By default MongoDB 3.2 will allocated 50% of the RAM (assume you have more than a GB) for the WirdTiger Engine...

Kevin Adistambha

unread,
Aug 24, 2017, 12:49:42 AM8/24/17
to mongodb-user

Hi Eric

mongod process keeps using huge amount of memory even though client threads that do some processing are done hours ago. Yet mongo keeps using RAM memory of about 70%. Any ideas why this is happenning ?

Unless you’re experiencing a specific performance issue, this is normal and expected. It takes time to fetch data from disk to RAM, so MongoDB was designed to utilize RAM as much as possible to provide you with fast performance.

Aside from the WiredTiger cache Rhys mentioned, imagine if MongoDB removes everything from RAM every time a client disconnects. If another client connects and ask for the same dataset, it would then have to reload things it just ejected from RAM. This would be a very inefficient use of time and RAM, so MongoDB would keep loaded data in its cache and as much in RAM as possible since disk access is very expensive. Therefore, if there is no reason to remove cached data from RAM, MongoDB will just keep it there.

Best regards,
Kevin

Reply all
Reply to author
Forward
0 new messages