Skip to content

docs(cpp/faq): Add RAM disk usage instructions for IntelliSense cache (ipch) - #8859

Closed
Devank Gupta (Devankguptaa) wants to merge 3 commits into
microsoft:mainfrom
Devankguptaa:docs/ramdisk-ipch
Closed

Devank Gupta (Devankguptaa) wants to merge 3 commits into
microsoft:mainfrom
Devankguptaa:docs/ramdisk-ipch

Conversation

@Devankguptaa

Copy link
Copy Markdown

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
Copy Markdown
Author

@microsoft-github-policy-service agree

@ntrogh

Copy link
Copy Markdown
Collaborator

Alexandra Kemper (@AlexandraKemperMS) Can you review this PR?

@sean-mcmanus

Copy link
Copy Markdown
Contributor

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

@sean-mcmanus

Sean McManus (sean-mcmanus) commented Sep 2, 2025 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Author

Thanks for the feedback, Sean McManus (@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
Copy Markdown
Author

can you review my PR??

@sean-mcmanus

Copy link
Copy Markdown
Contributor

can you review my PR??

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

@Devankguptaa

Copy link
Copy Markdown
Author

can you now review my PR??

@ntrogh

Copy link
Copy Markdown
Collaborator

Sean McManus (@sean-mcmanus) I discussed this with Alexandra Kemper (@AlexandraKemperMS) and because this is a very specific use case, she suggested to include this in the wiki over here: https://github.com/microsoft/vscode-cpptools/wiki/Optimizing-your-configuration

WDYT?

@Devankguptaa

Copy link
Copy Markdown
Author

Sean McManus (@sean-mcmanus) can you check??

@sean-mcmanus

Copy link
Copy Markdown
Contributor

The wiki seems good to me.

@Devankguptaa

Copy link
Copy Markdown
Author

Nick Trogh (@ntrogh) can you merge my PR now??

@ntrogh

Copy link
Copy Markdown
Collaborator

Devank Gupta (@Devankguptaa) The decision was to include this guidance in the wiki (https://github.com/microsoft/vscode-cpptools/wiki/Optimizing-your-configuration) and not in the C++ docs.

I'll close this PR - can you create a request in the microsoft/vscode-cpptools repo?

@Devankguptaa

Copy link
Copy Markdown
Author

Hi Nick Trogh (@ntrogh) 👋
I’m not able to fork the microsoft/vscode-cpptools.wiki repository on GitHub.
Could you please guide me on how to proceed with contributing the changes?

@ntrogh

Copy link
Copy Markdown
Collaborator

Sean McManus (@sean-mcmanus) Can you provide guidance on how to best proceed? Should Devank Gupta (@Devankguptaa) file an issue with the wiki updates?

@sean-mcmanus

Sean McManus (sean-mcmanus) commented Oct 7, 2025 •

Copy link
Copy Markdown
Contributor

Alexandra Kemper (@AlexandraKemperMS) Nick Trogh (@ntrogh) I don't think users can create a PR to update the Wiki? Or I could be mistaken...it might be possible via git clone https://github.com/microsoft/vscode-cpptools.wiki.git? I haven't tried.

@ntrogh

Copy link
Copy Markdown
Collaborator

Sean McManus (@sean-mcmanus) I suggest creating an issue and providing the details for updating the wiki in there.

@Devankguptaa

Copy link
Copy Markdown
Author

Sean McManus (@sean-mcmanus) can you raise the issue?

@sean-mcmanus

Copy link
Copy Markdown
Contributor

@Devankguptaa

Copy link
Copy Markdown
Author

Sean McManus (@sean-mcmanus) should I have to raise the PR again or it will be automatically merged?

@Devankguptaa

Copy link
Copy Markdown
Author

Sean McManus (@sean-mcmanus) should I have to raise the PR again or it will be automatically merged?

@sean-mcmanus

Copy link
Copy Markdown
Contributor

Devank Gupta (@Devankguptaa) Merged where? To the wiki?

@Devankguptaa

Copy link
Copy Markdown
Author

Sean McManus (@sean-mcmanus) Yes to the wiki

@sean-mcmanus

Copy link
Copy Markdown
Contributor

Devank Gupta (@Devankguptaa) We can add it to the wiki page after someone reviews it.

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