Skip to content

Conversation

Devankguptaa
Copy link

This PR updates the C/C++ FAQ to clarify how developers can place the IntelliSense cache (ipch) on a RAM disk.

Changes made

  • Added a new FAQ entry: “Can I put the IntelliSense cache (ipch) on a RAM disk?”
  • Provided instructions for:
    • macOS: APFS RAM disk example
    • Linux: tmpfs mount example
    • Windows: ImDisk (third-party tool) example
  • Fixed code block formatting (bash / json) for proper rendering.
  • Added notes about cache volatility, rebuild behavior, and size limits.

Why this is useful

Checklist

  • Clear cross-platform setup instructions
  • Verified Markdown formatting locally
  • Keeps consistent style with existing FAQ entries

@Devankguptaa
Copy link
Author

@microsoft-github-policy-service agree

@ntrogh ntrogh added this to the Backlog milestone Sep 2, 2025
@ntrogh
Copy link
Contributor

ntrogh commented Sep 2, 2025

@AlexandraKemperMS Can you review this PR?

@sean-mcmanus
Copy link
Contributor

The issue microsoft/vscode-cpptools#13890 also mentions the browse database, e.g. C_Cpp.default.browse.databaseFilename.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Sep 2, 2025

This doesn't seem like a good use of memory to me. I think it would be a better to use the memory for the IntelliSense processes themselves (which memory map the ipch files, so by having the ipch files in memory you're essentially using twice as much memory). Users who are concerned with ipch writing should set C_Cpp.intelliSenseCacheSize to 0. If the cache is using memory, then it'll cause few IntelliSense processes to be available in memory.

Do you have any data or performance data for scenarios where this actually improves performance?

...well, it would improve performance if you had a set of files that were frequently opened/closed causing the IntelliSense process to shutdown/restart frequently...but the user might be better off just keeping the files open (keep the cpptools-srv process running).

@sean-mcmanus
Copy link
Contributor

The comment Improves IntelliSense responsiveness for large projects. is not valid because the IntelliSense cache only stores information on a single TU's headers which is not directly related to the size of a project -- the comment would be valid if applied to the browse database (C_Cpp.default.browse.databaseFilename), which is larger for larger projects. A small project could still use large ipch files (i.e. including data on system/external headers).

@Devankguptaa
Copy link
Author

Thanks for the feedback, @sean-mcmanus . I’ve updated the FAQ:

  • Removed the performance claim and clarified that a RAM disk does not generally improve IntelliSense performance and may increase memory usage because ipch files are memory-mapped.
  • Emphasized the primary use case as minimizing SSD writes.
  • Added a tip to set "C_Cpp.intelliSenseCacheSize": 0 to disable the cache entirely if avoiding disk writes is the goal.
  • Added a Related note pointing to C_Cpp.default.browse.databaseFilename as the location of the browse database (larger for bigger projects), without recommending RAM disk for it.

@Devankguptaa
Copy link
Author

can you review my PR??

@sean-mcmanus
Copy link
Contributor

can you review my PR??

I think our team might be busy right now. I might be able to review it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants