paritytech / paritytech/parity-db
Memory usage on Windows
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 287
- Forks
- 68
- PR merge metrics
- No merged PRs in 30d
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 https://github.com/paritytech/parity-db/pull/235 has a major impact).
I tried to convince Windows developers that it makes no sense, but they remain unshakable, see discussion at https://github.com/rust-lang/rust/issues/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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked Subspace wrapper in crates/subspace-farmer/src/single_disk_farm/unbuffered_io_file_windows.rs and the linked Rust discussion. Determine how direct, unbuffered Windows reads could fit parity-db; done would mean a defined library or integration approach that provides controllable memory usage on Windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100