Skip to content

Memory usage on Windows #239

@nazar-pc

Description

@nazar-pc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions