The program I needed is here. Right after startup it loads the names of all files in the project folder. If you search only in file names, the search is almost instant, because those names are already loaded in memory. If you search in file contents for the first time, all the contents are loaded into memory, and the next search in contents is almost instant too. I was pleasantly surprised that loading 25,256 files (into one collection with the full file path, into a second one with just the file names, and into a third dictionary with the full file path as the key and the entire file content as the value) took 305 MB while the program was still running under vshost:

After the initial load of 25256 files (only into the collections of file paths and their names without the path), the program takes up this much:

That was visible when searching for the term “Mona“, but I am not sure about that anymore. Then I ran the program on its own without Visual Studio in the Release configuration, again for the term “Mona” while searching in contents, and I got these values:

What annoyed me a bit, though, was that the program failed to load 20,987 files (the problem was more in the TabControl than in the ListView). It always got up to about 315 MB in memory at most, and then a .NET window appeared that could not tell me anything at all, because it was completely white, and there was nothing left to do but kill it:

