VSCode-Cpptools/ipch/folders. should i delete them? or are they necessary everytime i use it? #10637
-
using TreeSize Free i manage to delete and locate unnecessary files(previously undeleted game files, cache files from uninstalled apps, etc.) taking too much space in my disks. Then finally i came across to this: Additional context, whenever i made and try to compile a file, i always prefer doing it via Bash commandline such as "g++ filename.cpp -o finalfilename". not sure if i should mention this but worth adding if needed a better context on how i use C++ in my VSCode. So i have a questions:
I hope I can ask this questions since i currently wanted to know and clarify what are this folders for. So in the future i know what can i remove and retain in, but ultimately is to learn their purpose. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 17 replies
-
The ipch cache folder can be safely deleted -- it's just used to speed up IntelliSense for any C/C++ files that are opened. It's better to delete the folder after closing VS Code though, in case one of our extension processes is using a cache file. |
Beta Was this translation helpful? Give feedback.
-
what do you mean by "saved up my .cpp, .c, .h files" |
Beta Was this translation helpful? Give feedback.
-
As developers of this extension, could you please consider providing an exhaustive and complete list of folders and files that can be safely deleted without breaking any functionality? Then, it is up to the user to decide to delete the ipch files as and when they are comfortable doing so. It is quite strange that users have to ask why there are so many files and folders created all over the place which are multiple GBs in size. These files add up quickly and hard disk space is at a premium. I have posted this question with Visual Studio IDE as well (which also has the sneaky tendency to create arbitrary files multiple GBs in size all over the place) but have had trouble figuring out the exact files that can be safely deleted. |
Beta Was this translation helpful? Give feedback.
-
Is there a setting we can configure somewhere to reduce the size of the cache? |
Beta Was this translation helpful? Give feedback.
-
Got the same problem: |
Beta Was this translation helpful? Give feedback.
-
Hi, I also found out my vscode-cpptools/ipch directory is filling a considerable amount of disk space, here is the recursive listing with sizes. The sizeable files correspond to .cpp files in my workspace. I'm using vscode-insiders 1.87.0 on a Mac BigSur 11.7.10. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Well that folder took 249G on my system. Maybe implementing some kind of cache eviction policy would be a good thing |
Beta Was this translation helpful? Give feedback.
All of the files we create can be safely deleted. They are caches that exist to make IntelliSense features faster. If we look for them and they are gone we will simply re-create them.
Any given workspace can override where our databases and IntelliSense caches (ipch) are written to, but in the absence of such an override, they will go here:
Windows -
%localappdata%/Microsoft/vscode-cpptools
macOS -
~/Library/Caches/vscode-cpptools
Linux -
$XDG_CACHE_HOME/vscode-cpptools
or~/.cache/vscode-cpptools
if the env variable does not existReference:
vscode-cpptools/Extension/src/common.ts
Lines 1312 to 1334 in ae8c4ac