This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Microsoft.Python.LanguageServer excessive resource usage #495
Copy link
Copy link
Closed
Description
Kai Lichtenberg (@KaiLicht) commented on Sun Dec 16 2018
Environment data
- VS Code version: 1.30.0
- Extension version (available under the Extensions sidebar): 2018.12.1
- OS and version: macOS 10.14.1
- Python version (& distribution if applicable, e.g. Anaconda): Anaconda, Python 3.7.0
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
- Relevant/affected Python packages and their versions: --
Expected behaviour
Microsoft.Python.LanguageServer is using a reasonable amount of ressources.
Actual behaviour
Microsoft.Python.LanguageServer is using 100%+ CPU Power which is of course draining my battery very fast.
Steps to reproduce:
- Install and git pull the library fast.ai
- Open the folder in VSCode
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
There's no output generated.
Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)
[ms-python.python]: Command `python.datascience.exportoutputasnotebook` appears multiple times in the `commands` section.
TMSyntax.ts:46 Overwriting grammar scope name to file mapping for scope source.python.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/python/syntaxes/MagicPython.tmLanguage.json.
New grammar file: file:///Users/kai/.vscode/extensions/magicstack.magicpython-1.1.0/grammars/MagicPython.tmLanguage
e.register @ TMSyntax.ts:46
t._handleGrammarExtensionPointUser @ TMSyntax.ts:329
(anonymous) @ TMSyntax.ts:182
e._handle @ extensionsRegistry.ts:114
e.acceptUsers @ extensionsRegistry.ts:98
t._handleExtensionPoint @ extensionService.ts:490
t._onHasExtensions @ extensionService.ts:344
(anonymous) @ extensionService.ts:332
(anonymous) @ errors.ts:237
s.__generator.a.label @ errors.ts:237
s @ errors.ts:237
Promise resolved (async)
c @ errors.ts:237
s @ errors.ts:237
Promise resolved (async)
c @ errors.ts:237
o @ errors.ts:237
o @ errors.ts:237
t._scanAndHandleExtensions @ extensionService.ts:319
(anonymous) @ extensionService.ts:114
requestIdleCallback (async)
t.runWhenIdle @ async.ts:730
(anonymous) @ extensionService.ts:111
Promise resolved (async)
t._startDelayed @ extensionService.ts:109
t @ extensionService.ts:90
t.create @ types.ts:165
e._createInstance @ instantiationService.ts:104
e.createInstance @ instantiationService.ts:69
t.initServiceCollection @ shell.ts:466
t.renderContents @ shell.ts:171
t.open @ shell.ts:528
(anonymous) @ main.ts:147
Promise resolved (async)
(anonymous) @ main.ts:129
Promise resolved (async)
(anonymous) @ main.ts:125
Promise resolved (async)
(anonymous) @ main.ts:116
G @ main.ts:86
(anonymous) @ workbench.js:30
Promise resolved (async)
bootstrapWindow.load.removeDeveloperKeybindingsAfterLoad @ workbench.js:26
exports.load.e @ bootstrap-window.js:123
t._invokeFactory @ loader.js:970
t.complete @ loader.js:980
s._onModuleComplete @ loader.js:1580
s._onModuleComplete @ loader.js:1592
s._onModuleComplete @ loader.js:1592
s._onModuleComplete @ loader.js:1592
s._resolve @ loader.js:1542
s.defineModule @ loader.js:1206
s._onLoad @ loader.js:1283
(anonymous) @ loader.js:1453
e.triggerCallback @ loader.js:594
(anonymous) @ loader.js:588
t.load @ loader.js:745
e.load @ loader.js:588
i @ loader.js:1448
(anonymous) @ loader.js:1456
e.triggerErrorback @ loader.js:601
(anonymous) @ loader.js:588
(anonymous) @ loader.js:751
readFileAfterOpen @ fs.js:420
extensionHost.ts:329 [Extension Host] debugger listening on port 65352
extensionHost.ts:235 Extension Host
extensionHost.ts:236 Debugger listening on ws://127.0.0.1:65352/8dd1261d-3e1b-46fa-95cc-1cad6f5fd490
For help see https://nodejs.org/en/docs/inspector
log.ts:157 INFO no standard startup: not a new window
console.ts:134 [Extension Host] [UriError]: Scheme is missing: {scheme: "", authority: "", path: "", query: "", fragment: ""}
t.log @ console.ts:134
t._logExtensionHostMessage @ extensionHost.ts:453
(anonymous) @ extensionHost.ts:244
emitTwo @ events.js:126
emit @ events.js:214
emit @ internal/child_process.js:772
_combinedTickCallback @ internal/process/next_tick.js:141
_tickCallback @ internal/process/next_tick.js:180
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value:
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value:
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value:
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value:
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */python
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */*/python
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value:
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value:
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value:
console.ts:134 [Extension Host] Python Extension: Register Intepreter Watcher, Arg 1: {"$mid":1,"fsPath":"/Users/kai/Dropbox/SCRATCH/fastai","external":"file:///Users/kai/Dropbox/SCRATCH/fastai","path":"/Users/kai/Dropbox/SCRATCH/fastai","scheme":"file"}, Return Value:
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */python
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */*/python
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value:
console.ts:134 [Extension Host] Python Extension: Build the workspace interpreter watcher, Arg 1: {"$mid":1,"fsPath":"/Users/kai/Dropbox/SCRATCH/fastai","external":"file:///Users/kai/Dropbox/SCRATCH/fastai","path":"/Users/kai/Dropbox/SCRATCH/fastai","scheme":"file"}, Return Value: UNABLE TO DETERMINE VALUE
console.ts:134 [Extension Host] Python Extension: Register Intepreter Watcher, Arg 1: undefined, Return Value:
console.ts:134 [Extension Host] Python Extension: Build the workspace interpreter watcher, Arg 1: undefined, Return Value: UNABLE TO DETERMINE VALUE
console.ts:134 [Extension Host] Python Extension: Get Platform Version, , Return Value: {"raw":"18.2.0","major":18,"minor":2,"patch":0,"prerelease":[],"build":[],"version":"18.2.0"}
console.ts:134 [Extension Host] Python Extension: Get language server folder name, , Return Value: "languageServer.0.1.72"
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value:
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value:
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
jakebailey commentedon Dec 17, 2018
This project hits a debug assertion:
keyshows asClass NoneType,existingKeyshows astype, andnewKeyshows asNone. The thing being analyzed seems to befastai.tabular.data.from_df.MikhailArkhipov commentedon Dec 17, 2018
This means instance comparer said new object is the same as one in the hash set but calculated hash codes did not match. Debug only, in release it basically just adds new object. Check what compares types and why hash code comes out different.
jakebailey commentedon Dec 17, 2018
Disabling that check to see what it would do in release mode reproduces the "memory usage doesn't change, but CPU stays at 100% of a core". Seems like it's all being done here:
One thing I'm seeing is that this project imports
typingstuff indirectly through*imports of other files.ilkkapaloheimo commentedon Dec 18, 2018
I have similar problem on my Win 10 laptop (16 GB) with latest versions of everything (Anaconda/Python, VS Code, Visual Studio IntelliCode -Preview, ...). Python.Language.Server eventually consumes all available memory at the rate of approx. 500 MB/min.
Steps to reproduce:
import pandasto your test.py file, then wait a littleSame behaviour happens also with other libraries. Because of this I can't use the Intellicode (Preview) feature, but have to revert back to Jedi.
jakebailey commentedon Dec 18, 2018
The original issue in this thread seems to be more in the vein of "stable memory, high CPU with no progress". Your issue seems closer to #450.
Also related to this issue is the (older) #479, which seems to have the same symptoms as the OP.
KaiLicht commentedon Dec 19, 2018
For me (OP) it's definitely stable memory, high CPU. #479 seems very similar.
Mitigate some of #495 via MRO member selection and analysis set optim…
ogrisel commentedon Jan 21, 2019
Kai Lichtenberg (@KaiLicht) I observed a similar problem on the scikit-learn repo.
Here is the section of my settings to use the beta version of the language server with VS code and get trace level debug output in the "Python" output view.
{ "python.analysis.logLevel": "Trace", "python.analysis.downloadChannel": "beta", "python.jediEnabled": false }Mitigate some of microsoft#495 via MRO member selection and analysis …
Cherry pick fixes from Release branch into PTVS branch (#578)
MikhailArkhipov commentedon Feb 6, 2019
Around 400MB, ~20 sec.

MikhailArkhipov commentedon Feb 6, 2019
#546
MikhailArkhipov commentedon Mar 6, 2019
0.2.16 is now available on beta channel.
eweiguu commentedon Mar 14, 2019
really promising after upgrade to this beta version.