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

High Memory Usage on 2018.9.0 #2923

Closed
alexcouper opened this Issue Oct 17, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@alexcouper

alexcouper commented Oct 17, 2018

Environment data

  • VS Code version: 1.28.1
  • Extension version (available under the Extensions sidebar): 2018.9.0
  • OS and version: Mac OSX 10.13.6
  • Python version (& distribution if applicable, e.g. Anaconda): python3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pyenv

Actual behavior

Memory is eaten at an alarming rate (up to 20GB), high CPU usage (120%)

Expected behavior

No such memory and CPU usage

Steps to reproduce:

  1. I have a repository (using https://www.pantsbuild.org/) that has only 344 python files I actually care about, but 13000 python files in pants temporary storage - held in .pants.d in the root of the repository.
  2. Open up VS Code
  3. Wait a few minutes and watch the memory get consumed by Microsoft.Python.LanguageServer

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Microsoft Python language server.
Microsoft Python Language Server version 0.1.42.0
Initializing for /Users/alex/.pyenv/versions/vscode/bin/python
Reloading modules...
Reloading modules...
Reloading modules...
Reloading modules...
Reloading modules...

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

 INFO no standard startup: panel is active
console.ts:136 [Extension Host] Python Extension: Get language server folder name, , Return Value: "languageServer.0.1.42"
console.ts:136 [Extension Host] Failed to get interpreter information for '/Users/alex/.pyenv/shims/python2.7' SyntaxError: Unexpected token p in JSON at position 0
	at JSON.parse (<anonymous>)
	at PythonExecutionService.<anonymous> (/Users/alex/.vscode/extensions/ms-python.python-2018.9.0/out/client/common/process/pythonProcess.js:42:35)
	at Generator.next (<anonymous>)
	at fulfilled (/Users/alex/.vscode/extensions/ms-python.python-2018.9.0/out/client/common/process/pythonProcess.js:12:58)
	at <anonymous>
t.log @ console.ts:136
console.ts:136 [Extension Host] Failed to get interpreter information for '/Users/alex/.pyenv/shims/python2' SyntaxError: Unexpected token p in JSON at position 0
	at JSON.parse (<anonymous>)
	at PythonExecutionService.<anonymous> (/Users/alex/.vscode/extensions/ms-python.python-2018.9.0/out/client/common/process/pythonProcess.js:42:35)
	at Generator.next (<anonymous>)
	at fulfilled (/Users/alex/.vscode/extensions/ms-python.python-2018.9.0/out/client/common/process/pythonProcess.js:12:58)
	at <anonymous>
t.log @ console.ts:136
console.ts:136 [Extension Host] Failed to get interpreter information for '/Users/alex/.pyenv/shims/python3.4' SyntaxError: Unexpected token p in JSON at position 0
	at JSON.parse (<anonymous>)
	at PythonExecutionService.<anonymous> (/Users/alex/.vscode/extensions/ms-python.python-2018.9.0/out/client/common/process/pythonProcess.js:42:35)
	at Generator.next (<anonymous>)
	at fulfilled (/Users/alex/.vscode/extensions/ms-python.python-2018.9.0/out/client/common/process/pythonProcess.js:12:58)
	at <anonymous>
t.log @ console.ts:136
console.ts:136 [Extension Host] Failed to get interpreter information for '/Users/alex/.pyenv/shims/python3.6' SyntaxError: Unexpected token p in JSON at position 0
	at JSON.parse (<anonymous>)
	at PythonExecutionService.<anonymous> (/Users/alex/.vscode/extensions/ms-python.python-2018.9.0/out/client/common/process/pythonProcess.js:42:35)
	at Generator.next (<anonymous>)
	at fulfilled (/Users/alex/.vscode/extensions/ms-python.python-2018.9.0/out/client/common/process/pythonProcess.js:12:58)
	at <anonymous>
t.log @ console.ts:136
2console.ts:136 [Extension Host] Failed to get interpreter information for '/usr/local/bin/python3.4' SyntaxError: Unexpected token p in JSON at position 0
	at JSON.parse (<anonymous>)
	at PythonExecutionService.<anonymous> (/Users/alex/.vscode/extensions/ms-python.python-2018.9.0/out/client/common/process/pythonProcess.js:42:35)
	at Generator.next (<anonymous>)
	at fulfilled (/Users/alex/.vscode/extensions/ms-python.python-2018.9.0/out/client/common/process/pythonProcess.js:12:58)
	at <anonymous>
t.log @ console.ts:136

Workspace Settings:

{
    "python.linting.pylintEnabled": false,
    "python.linting.enabled": false,
    "python.pythonPath": "/Users/alex/.pyenv/versions/vscode/bin/python",
    "python.formatting.blackArgs": [],
    "python.formatting.provider": "black",
    "python.jediEnabled": false,
    "beautify.onSave": true,
    "editor.formatOnSave": true,
    "beautify.JSfiles": [
        "js",
        "json",
        "css",
        "jsbeautifyrc",
        "jshintrc",
        "ts"
    ]
}

User Settings:

{
    "explorer.confirmDragAndDrop": false,
    "go.vetOnSave": "off",
    "go.lintOnSave": "off",
    "go.buildOnSave": "off",
    "explorer.confirmDelete": false,
    "files.associations": {
        "BUILD": "python"
    },
    "window.zoomLevel": 1,
    "files.useExperimentalFileWatcher": true,
    "files.exclude": {
        "**/.git": true, // this is a default value
        "**/.DS_Store": true, // this is a default value
        "**/node_modules": true, // this excludes all folders 
        // named "node_modules" from 
        // the explore tree
        // alternative version
        "node_modules": true, // this excludes the folder 
        // only from the root of
        // your workspace 
        ".pants.d": true,
        ".pants.d.old": true,
        "*.pyc": true,
        ".pytest_cache": true,
        ".cache": true,
        ".pids": true,
        "dist": true
    },
    "python.workspaceSymbols.exclusionPatterns": [
        "**/site-packages/**",
        "**/.pants.d/**"
    ],
    "python.analysis.watchSearchPaths": false
}

Related issues that I read before coming here:

#2594
#2553

@brettcannon

This comment has been minimized.

Member

brettcannon commented Oct 17, 2018

Duplicate of #2838

@brettcannon

This comment has been minimized.

Member

brettcannon commented Oct 19, 2018

I will also mention, @alexcouper , that we are using files.exclude to exclude files to index (or at least we should be 😉 ).

@alexcouper

This comment has been minimized.

alexcouper commented Oct 25, 2018

Thanks @brettcannon - I think you are right. Seems the issue is elsewhere.

I now have a project with only 428 python files using 12GB of memory...

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