简体   繁体   中英

How to reset mongodb memory cache programmatically

Could you please tell me how to reset mongodb memory cache as is keeps on piling up.

The memory cache is removed when I restart the mongod.exe.

Can I do this programmatically using C# for Windows?

MongoDB doesn't control the way it uses memory, because it uses memory mapped files. It leaves the caching up to the operating system, so there's no way for it to tell the OS how to restrict or uncache what it has. See: http://www.mongodb.org/display/DOCS/Caching

This is a good reason to make sure MongoDB is running on its own box. Otherwise, the free memory will be consumed, and other programs will struggle to get enough RAM from the OS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM