Visual Studio spawning massive amount of IPCH files in project root

Hi, I am working on a Unreal Engine 4.27 project (editor plugin) and every time I try to “Find all references” (Visual Studio 2022) of let’s say a method implemented in my project that might be called from the engine project (search entire solution) VS starts to spawn massive intellisense precompile header files in the root of my project and not the .vs dir. There are some IPCH files in the .vs/project/v17/ipch dir too but only about 6GB, which is OK. But these new files in project root are huge and numerous. Before the ref search finished my folder had 80GB+ of these. Every time I remove them VS creates them again when I try to find engine refs.

I do not want these files and I do not mind the slowdown but I was not able to find any setting that would disable their creation.

I posted this problem on MS forum but they have no fix it seems: Visual Studio spawning massive amount of IPCH files in project root - Microsoft Q&A

Could anyone please help me solve this?

1 Like

just found these in my UE5 project as well, over 40gb in the project root

1 Like

We have the same issue here.

1 Like

Hello,
You should avoid “Find all references” this VS feature is broken, it’s slow and never release ressources, also you can’t stop a search, the stop button doesn’t work.
Instead you may use “Find and replace” tab, to search you can use regex/exact match you should also exclude some file extension/folders.
Example you can set File types to:
“!.ini;!.cs;!.natvis;!/Shaders/;!/Intermediate/;!/Engine/Source/ThirdParty/*”
means do not search files of type config, build/target. and do not search in, Shaders/intermediate/Thirdparty. You can also regroup the matching result by path and file to see where your query match.

About IPCH / VS database, I’ve not tested the MS recommendation:
“Always use fallback location” but did you tried to set the “Fallback Location” and set to a folder you create in project paths e.g “…/Unreal Projects/VSDB” All your projects would search this path, this could have side effect with different engine version etc.

Instead to prevent the .VS folder creation:
Tools->Options->Text Editor->C / C+±>Advanced->Intellisense->Disable automatic precompiled header : true
With this settings intellisense is “slower” when you reoppen a file after closing vs.
In reality this is quite fast and it prevent project size ballooning.
I think this should be a recommended setting in epic visual studio setup documentation.

1 Like