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
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