Skip to content

Editor Services memory consumption is large due to Script Analyzer #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rkeithhill opened this issue Aug 13, 2016 · 4 comments
Closed

Comments

@rkeithhill
Copy link
Contributor

rkeithhill commented Aug 13, 2016

I'm not sure if this existed previous to 0.6.2 but given the small number of changes to 0.6.2, it must have. Anyway, while working on Plaster in VSCode today I noticed that the PSES language server process was consuming ~278 MB! I created a dump file and loaded it into 2015 to analyze the managed memory. This is what I see:

pses-memory-hog

If I burrow into the PSSA helper class I see:

pses-pssa-mem-hog

Note that helper is a static, so it will never get collected and anything it has a reference to will never get collected on down the line. Looking inside it, we see that it is holding onto a lot of AST:

pses-helper-mem-hog

The DMP file is about 610 MB and I could make it available via my OneDrive account but I suspect you could recreate it pretty easily. I'm on VSCode 1.4.0, Windows 10 1607 and PSSA 1.5.0.

@daviwil
Copy link
Contributor

daviwil commented Aug 15, 2016

Yikes, good old 'Helper' class finally comes home to roost. This was something I had pointed out a while back but we never got around to refactoring the code to get rid of it. If nothing else we should definitely not be consuming so much memory over time.

Tagging @kapilmb so that he sees this analysis.

@kapilmb
Copy link

kapilmb commented Aug 15, 2016

Looks like an instance of VariableAnalysis class is taking up a lot of memory. Will have a look at it.

@daviwil
Copy link
Contributor

daviwil commented Aug 15, 2016

Awesome, thanks Kapil!

@daviwil daviwil changed the title EditorServices memory consumption if large Editor Services memory consumption is large due to Script Analyzer Aug 15, 2016
@kapilmb
Copy link

kapilmb commented Nov 18, 2016

It turns out PSSScriptAnalyzer keeps adding ASTs to the dictionary without removing them even after having no use of them. But since, EditorService now uses Invoke-ScriptAnalyzer to get the diagnostic markers, this would not be an issue. I think we can close this issue now.

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

No branches or pull requests

3 participants