Wan2.2 generations degrade due to unreclaimed Windows Standby Memory (not a ComfyUI leak) — fixed via RAMMap Empty Standby List
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
### Custom Node Testing
- [ ] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)
### Expected Behavior
Possible root cause insight, not a ComfyUI-internal leak:
Ran into this exact symptom (Wan2.2, RTX 5060 Ti 16GB, Windows 11) — generations fine for the first several runs, then severe SSD thrashing, requiring a full reboot to clear (process restart alone insufficient).
Used Sysinternals RAMMap to inspect memory state during the slowdown. Found ~13.3GB sitting in Standby (Mapped File) — matching almost exactly the size of the loaded diffusion model — while genuinely Free memory had dropped to ~40MB.
Clicking Empty Standby List in RAMMap immediately resolved the SSD thrashing, without needing a reboot.
This suggests the issue may not be a traditional memory leak inside ComfyUI's own process, but rather Windows' Standby List (memory-mapped file cache) not being reclaimed/reused efficiently across repeated model loads of the same large file — possibly because each Requested to load WAN21 event creates a fresh mapping rather than reusing the previous one. Might be worth checking whether the model loading code could reuse an existing mmap rather than remapping the file each time, or whether there's a way to hint Windows to release the old mapping before creating a new one.
Console log signature each time before the slowdown: Requested to load WAN21 / Model WAN21 prepared for dynamic VRAM loading. 13630MB Staged. — happens on every single generation, not just the first.
### Actual Behavior
Possible root cause insight, not a ComfyUI-internal leak:
Ran into this exact symptom (Wan2.2, RTX 5060 Ti 16GB, Windows 11) — generations fine for the first several runs, then severe SSD thrashing, requiring a full reboot to clear (process restart alone insufficient).
Used Sysinternals RAMMap to inspect memory state during the slowdown. Found ~13.3GB sitting in Standby (Mapped File) — matching almost exactly the size of the loaded diffusion model — while genuinely Free memory had dropped to ~40MB.
Clicking Empty Standby List in RAMMap immediately resolved the SSD thrashing, without needing a reboot.
This suggests the issue may not be a traditional memory leak inside ComfyUI's own process, but rather Windows' Standby List (memory-mapped file cache) not being reclaimed/reused efficiently across repeated model loads of the same large file — possibly because each Requested to load WAN21 event creates a fresh mapping rather than reusing the previous one. Might be worth checking whether the model loading code could reuse an existing mmap rather than remapping the file each time, or whether there's a way to hint Windows to release the old mapping before creating a new one.
Console log signature each time before the slowdown: Requested to load WAN21 / Model WAN21 prepared for dynamic VRAM loading. 13630MB Staged. — happens on every single generation, not just the first.
### Steps to Reproduce
That's genuinely useful, specific, evidence-based information most people hitting this bug wouldn't have thought to check. If you ever want to post it, it's ready to go — no further work needed on your end beyond copy-paste. If not, no loss either way; you've got the fix for your own machine regardless.
### Debug Logs
```powershell
That's genuinely useful, specific, evidence-based information most people hitting this bug wouldn't have thought to check. If you ever want to post it, it's ready to go — no further work needed on your end beyond copy-paste. If not, no loss either way; you've got the fix for your own machine regardless.
```
### Other
_No response_
Contributor guide
Research direction
Start by reproducing repeated Wan21 generations on Windows 11 and capture the “Requested to load WAN21” and “13630MB Staged” log sequence. Inspect the model-loading path responsible for those events, then compare RAMMap Standby (Mapped File) and free memory across runs; done means repeated generations no longer cause SSD thrashing without manually emptying the standby list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning, operating-systems, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100