You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cpp/faq-cpp.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,53 @@ This setting allows you to set a limit on the amount of caching the extension do
83
83
84
84
If you do not want to use the IntelliSense caching feature (such as to work around a bug that may only occur when the cache is enabled), you can disable the feature by setting the **IntelliSense Cache Size** setting to 0 (or `"C_Cpp.intelliSenseCacheSize": 0"` in the JSON settings editor). Disabling the cache may also be beneficial if you're seeing excessive disk writing, particularly when editing headers.
85
85
86
+
## Can I put the IntelliSense cache (ipch) on a RAM disk?
87
+
88
+
Yes. The C/C++ extension lets you relocate and limit the IntelliSense cache:
89
+
90
+
-**`C_Cpp.intelliSenseCachePath`** — where the `ipch` cache is stored
91
+
-**`C_Cpp.intelliSenseCacheSize`** — maximum cache size in MB (set to `0` to disable)
92
+
93
+
By default, the cache lives under your user cache directory (Windows: `%LocalAppData%/Microsoft/vscode-cpptools`, Linux: `$XDG_CACHE_HOME/vscode-cpptools/` or `~/.cache/vscode-cpptools/`, macOS: `~/Library/Caches/vscode-cpptools/`). If you want to minimize SSD writes, you can mount a RAM-backed filesystem and point the cache there.
94
+
However, using a RAM disk does not generally improve IntelliSense performance and may increase memory usage, since the cache files are already memory-mapped by the IntelliSense processes.
95
+
96
+
> **Notes**
97
+
> - A RAM disk is volatile. The cache will be cleared on reboot/unmount (the cache will rebuild automatically).
98
+
> - Set `C_Cpp.intelliSenseCacheSize` ≤ your RAM disk size.
99
+
> - This is a per-user setting and works across all workspaces.
100
+
> - If your main concern is reducing disk writes (e.g., SSD wear), you can also set `"C_Cpp.intelliSenseCacheSize": 0` to completely disable the cache instead of relocating it.
101
+
102
+
> **Related:** The tag parser “browse” database path can be customized with
103
+
> `"C_Cpp.default.browse.databaseFilename"`. Moving it to a RAM disk is generally not recommended for performance, but the path can be changed if needed.
0 commit comments