Memory leak during indexing (Windows 10, dynamic cache, metafile, ReFS)
Posted: Sat Sep 23, 2017 11:27 am
I've a Windows 10 and have encountered a serious problem during indexing my ReFS partition (I don't know if this happens also with NTFS). I spotted a huge increase of memory usage while reindex is in progress. I diagnosed this problem and came to these conclusions:
- 1. It is not Everything's fault. It's Windows 10's dynamic cache used for file IO that gets bloated (link, link). In short, if there's a lot of quick/frequent IO demand, Windows caches it in RAM. The demand can be caused by, of course, Everything's full partition reindex, but also as simple as selecting all folders on your root partition and invoking Properties. Even if it seems like Windows problem, I still decided to report this here, because I hope Everything code can be upgraded to overcome this issue. 2. The memory section where the leak is happening is metafile section, which is somewhat invisible in Windows Task Manager: It won't show in any column in Processes nor Details tab, but it's a part of the total In use bytes charted on Performance tab. Because of that you can see a 100% memory usage, but if you sum the memory column on Processes tab, it won't match (by many GiB). The missing part is the metafile section. which you can see in Performance Monitor by creating a counter for System Cache Residual Bytes (not Process Private Bytes, where usual memory leaks happen). You can also (and easier) see it using RAMMap app from Windows Internals (link). The problem is clearly visible on the screenshot I attached: 3. When I force emptying of this section (Empty > Empty System working set in RAMMap), the memory is released (or rather, flagged as inactive, but Task Manager can see this RAM as now free):