Some MongoDB users on Windows have switched to enabling direct_io because the file system cache on Windows is greedy by default and can lead to content in allocated memory getting swapped out - which leads to terrible performance.
Windows provides the SetSystemFileCacheSize API that allows limiting the amount of memory that can be used by the file system cache. The setting is global across the computer.
We could add code into MongoDB that calls the API, and limits the amount of memory the file system cache can use to a percentage of available memory.
The call should only be done for storage engines that have a cache management layer. MMAP relies on the file system cache using all available memory - limiting how much memory is available would hurt MMAP users.
There is further discussion in