-
Notifications
You must be signed in to change notification settings - Fork 64
Description
Hi, we've been battling memory usage on Windows at Subspace for a while and the gist of it is that Windows is just horribly bad at not using huge amounts of memory with memory-mapped files or any other files that don't disable buffering completely (I don't think #235 has a major impact).
I tried to convince Windows developers that it makes no sense, but they remain unshakable, see discussion at rust-lang/rust#122473
TL;DR: To get controllable memory usage on Windows the only solution is to throw Windows kernel's file system "smartness" out of the window to the maximum extent possible with FILE_FLAG_WRITE_THROUGH | FILE_FLAG_NO_BUFFERING and do direct reads manually. I wrote a wrapper for this purpose that I think may deserve to become a library.