microsoft / microsoft/vscode-cpptools

IntelliSense using too much memory and resetting pch

Open
#7,147 25 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Language Service performance Verifying - Internal
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Ok, got it.

Your PCH some logic has issues. I have 2 files PawnTank.h and PawnTank.cpp. If in PawnTank.ccp when I do a look up (hover with with left mouse button held down) cpptools.srv goes up as high as 2GB Real Mem then generates a 1.7GB PCH cache file for PawnTank.h. This takes about 50 seconds. If I close PawnTank.cpp, then reopen it, the whole process takes another 60 seconds as PawnTank.h PCH is regenerated unnecessarily yet again.

You're building a huge in memory cache structure, then dumping it when the file is closed. I recommend some sort've memory mapped DB that is local plus better cache invalidation logic.

The UE4 tutorial "Toon Tanks" is here https://gitlab.com/GameDevTV/UnrealCourse/ToonTanks. Install UE4, clone "Toon Tanks", build and step around, you'll see.

I didn't want this to be a career move so I'm going to live with what I've got.

I switched C_Cpp Tag Parser and for the time being, it works like a charm.

Originally posted by @magwa101 in https://github.com/microsoft/vscode-cpptools/issues/7143#issuecomment-796247121

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the UnrealCourse ToonTanks project, focusing on PawnTank.h and PawnTank.cpp while monitoring cpptools.srv memory use and PCH cache regeneration. Compare the behavior during hover lookup, closing, and reopening PawnTank.cpp; done would mean the lookup does not create excessive memory use or unnecessarily regenerate the PCH.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, unreal-engine
Domain
devtools, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.