pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

A promblem or question about pylance crashing in GPU rental platforms

Open QLYYLQ opened this issue 10 months ago • 10 comments

I faced a promblem when i using ssh to connect a server in GPU rental platforms which the pylance crashed every a few minutes. I had uninstall all extensions and only install python and pylance but couldn't solve the problem.

here is the picture about the problem image

ther is the OUTPUT about Python Language Server

2024-04-16 00:34:38.544 [info] [Error - 12:34:38 AM] Server process exited with signal SIGKILL.
2024-04-16 00:34:47.954 [info] [Error - 12:34:47 AM] Notify file events failed.
2024-04-16 00:34:47.954 [info] Error: Connection is disposed.
	at pe (/root/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2308075)
	at Object.sendNotification (/root/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2308918)
	at _.sendNotification (/root/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2352539)
	at async t.Delayer.<anonymous> (/root/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2364453)

At same time, i can still use pylance in local, which makes me confused

Is it a problem about GPU rental platforms or there are other reasons?

QLYYLQ avatar Apr 15 '24 17:04 QLYYLQ

I can confirm the same behavior, since my latest upgrade to VSCode v1.88.1 and ms-python v2024.4.1. No GPU rental platform here, but using a devcontainer. image

2024-04-19 16:09:13.760 [info] [Error - 4:09:13 PM] Server process exited with signal SIGABRT.
2024-04-19 16:11:40.796 [info] [Error - 4:11:40 PM] Notify file events failed.
2024-04-19 16:11:40.796 [info] Error: Connection is disposed.
    at pe (/home/dockeruser/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2308075)
    at Object.sendNotification (/home/dockeruser/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2308918)
    at _.sendNotification (/home/dockeruser/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2352539)
    at t.Delayer.<anonymous> (/home/dockeruser/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2364453)
2024-04-19 16:11:40.796 [info] [Error - 4:11:40 PM] Notify file events failed.
2024-04-19 16:11:40.796 [info] Error: Connection is disposed.
    at pe (/home/dockeruser/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2308075)
    at Object.sendNotification (/home/dockeruser/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2308918)
    at _.sendNotification (/home/dockeruser/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2352539)

(this message is repeated lots of times with varying delays ranging between 0 seconds and two hours in between)

clssn avatar Apr 19 '24 18:04 clssn

often time, this happens because container or remote has encountered OOM (out of memory), do you know how much memory you have for your remote env? does it have more than 4GB?

heejaechang avatar Apr 23 '24 22:04 heejaechang

Thanks for your suggestion! The container is not limited in memory and can access over 40GB. Memory should not be the issue.

clssn avatar Apr 27 '24 13:04 clssn

in that case, can you provide us some logs as described in the troubleshooting guide?

we would need full log starting form "start of the pylance" regardless how long the log is.

heejaechang avatar Apr 29 '24 17:04 heejaechang

In the troubleshooting I stumbled over a section where it reads like due to pointer compression pylance can only use 4GB of memory. But I saw it use way more (even around 6GB). Screenshot of VSCode process explorer showing 5943MB of memory used by the pylance extension: image

FYI: I'm on a monorepo, with over 5000 *.py files.

This is the trace level output you requested (slightly anonymized):

2024-05-02 12:29:26.363 [info] (Client) Pylance async client (2024.4.1) started with python extension (2024.4.1)
2024-05-02 12:29:28.359 [info] [Info  - 12:29:28 PM] (2849) Pylance language server 2024.4.1 (pyright version 1.1.356, commit 6652c4a8) starting
2024-05-02 12:29:28.386 [info] [Info  - 12:29:28 PM] (2849) Server root directory: file:///home/username/.vscode-server/extensions/ms-python.vscode-pylance-2024.4.1/dist
2024-05-02 12:29:28.564 [info] [Info  - 12:29:28 PM] (2849) Starting service instance "workspace"
2024-05-02 12:29:29.202 [info] [Info  - 12:29:29 PM] (2849) Background analysis(1) root directory: file:///home/username/.vscode-server/extensions/ms-python.vscode-pylance-2024.4.1/dist
2024-05-02 12:29:29.306 [info] [Info  - 12:29:29 PM] (2849) Background analysis(1) started
2024-05-02 12:29:31.168 [info] (2849) No configuration file found.
2024-05-02 12:29:31.280 [info] (2849) pyproject.toml file found at /workspace.
2024-05-02 12:29:31.617 [info] [Info  - 12:29:31 PM] (2849) Setting pythonPath for service "workspace": "/bin/python"
2024-05-02 12:29:31.654 [info] [Info  - 12:29:31 PM] (2849) Setting environmentName for service "workspace": "3.8.10 (global)"
2024-05-02 12:29:31.760 [info] [Info  - 12:29:31 PM] (2849) Loading pyproject.toml file at /workspace/some/anonymized/path
2024-05-02 12:29:31.789 [info] [Info  - 12:29:31 PM] (2849) Assuming Python version 3.8.10.final.0
2024-05-02 12:29:31.891 [info] (2849) Assuming Python platform Linux
2024-05-02 12:29:32.041 [info] [Info  - 12:29:32 PM] (2849) Search paths for file:///workspace
2024-05-02 12:29:32.157 [info] [Info  - 12:29:32 PM] (2849)   /home/username/.vscode-server/extensions/ms-python.vscode-pylance-2024.4.1/dist/typeshed-fallback/stdlib
2024-05-02 12:29:32.312 [info] [Info  - 12:29:32 PM] (2849)   /workspace
2024-05-02 12:29:32.444 [info] [Info  - 12:29:32 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:32.585 [info] [Info  - 12:29:32 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:32.608 [info] [Info  - 12:29:32 PM] (2849)   /home/username/.cache/python_system_dependencies/cv2.cpython-38-x86_64-linux-gnu.so
2024-05-02 12:29:32.986 [info] [Info  - 12:29:32 PM] (2849)   /workspace
2024-05-02 12:29:33.148 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.333 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.551 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.613 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.792 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.837 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.841 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.848 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.927 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.929 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.929 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.929 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.929 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.930 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.930 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.930 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.931 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.932 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /home/username/.vscode-server/extensions/ms-python.vscode-pylance-2024.4.1/dist/typeshed-fallback/stubs/...
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /home/username/.vscode-server/extensions/ms-python.vscode-pylance-2024.4.1/dist/bundled/stubs
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /home/username/.cache/python_system_dependencies/cv2.cpython-38-x86_64-linux-gnu.so
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.933 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.934 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.935 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /workspace/some/anonymized/path
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /usr/lib/python3.8
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /usr/lib/python3.8/lib-dynload
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /usr/local/lib/python3.8/dist-packages
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849)   /usr/lib/python3/dist-packages
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849) Adding fs watcher for library directories:
 file:///home/username/.cache/python_system_dependencies/cv2.cpython-38-x86_64-linux-gnu.so
file:///usr/lib/python3.8
file:///usr/lib/python3.8/lib-dynload
file:///usr/local/lib/python3.8/dist-packages
file:///usr/lib/python3/dist-packages
2024-05-02 12:29:33.936 [info] [Info  - 12:29:33 PM] (2849) Adding fs watcher for directories:
 file:///workspace
2024-05-02 12:29:33.936 [info] (2849) Searching for source files
2024-05-02 12:29:41.380 [info] [Error - 12:29:41 PM] (2849) Enumeration of workspace source files is taking longer than 10 seconds.
This may be because:
* You have opened your home directory or entire hard drive as a workspace
* Your workspace contains a very large number of directories and files
* Your workspace contains a symlink to a directory with many files
* Your workspace is remote, and file enumeration is slow
To reduce this time, open a workspace directory with fewer files or add a pyrightconfig.json configuration file with an "exclude" section to exclude subdirectories from your workspace. For more details, refer to https://github.com/microsoft/pyright/blob/main/docs/configuration.md.
2024-05-02 12:34:44.540 [info] 
<--- Last few GCs --->

[2849:0x67c0f60]   314502 ms: Mark-sweep 4034.7 (4129.6) -> 4018.9 (4129.8) MB, 1090.5 / 0.0 ms  (average mu = 0.087, current mu = 0.016) allocation failure; scavenge might not succeed
[2849:0x67c0f60]   316074 ms: Mark-sweep 4034.7 (4129.8) -> 4019.1 (4130.1) MB, 1555.6 / 0.0 ms  (average mu = 0.044, current mu = 0.010) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

2024-05-02 12:34:44.548 [info]  1: 0xb85bc0 node::Abort() [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
 2: 0xa94834  [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
 3: 0xd66d10 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
 4: 0xd670b7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
 5: 0xf447c5  [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
 6: 0xf456c8 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
 7: 0xf55bd3  [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
 8: 0xf56a48 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
 9: 0xf313ae v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
10: 0xf32777 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
11: 0xf1394a v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
12: 0x12d8caf v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]
13: 0x1705b39  [/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/node]

2024-05-02 12:34:45.165 [info] [Error - 12:34:45 PM] Server process exited with signal SIGABRT.
2024-05-02 12:38:04.158 [info] [Error - 12:38:04 PM] Notify file events failed.
2024-05-02 12:38:04.158 [info] Error: Connection is disposed.
    at pe (/home/username/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2308075)
    at Object.sendNotification (/home/username/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2308918)
    at _.sendNotification (/home/username/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2352539)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at processTimers (node:internal/timers:509:9)
    at t.Delayer.<anonymous> (/home/username/.vscode-server/extensions/ms-python.python-2024.4.1/out/client/extension.js:2:2364453)

By the way, I can't configure a custom path to a node executable via the "python.analysis.nodeExecutable" setting, because it can only be applied on a "local" settings file (so not in the devcontainer environment). We have no control over the dev's host packages and thus no generic way of determining the path to a node executable (as far as I understand). The devcontainer is our unified and controlled dev environment.

clssn avatar May 02 '24 10:05 clssn

vscode-server might use different custom version of node than vscode that has different memory limitation.

can you try this trick by puting this in env var for your remote host?

export NODE_OPTIONS="--max-old-space-size=8192" or set NODE_OPTIONS=--max-old-space-size=8192 if you are using windows.

make sure this is set on terminal vscode-server runs before vscode-server runs

  • the 8192 is max memory in megabytes that is allowed node to consume. you can try different number if you want.

heejaechang avatar May 02 '24 17:05 heejaechang

by the way, if you are not using/need all that 5000 py files, you can use python.analysis.exclude to exclude some of those files from being loaded into pylance.

if you are using multi root workspace, you can create .vscode/settings to each roots of workspace and put something like python.analysis.exclude: [ '**/somefolder/*.py' ] to exclude them.

heejaechang avatar May 02 '24 17:05 heejaechang

I'm seeing the same issue on a repo with 7000 py files. I have uninstalled and installed python, pylance extensions, removed them from cache and re-installed vscode, but Pylance keeps crashing for me

abist avatar May 02 '24 18:05 abist

@abist we can't be sure whether you are having the same issue without log and it would be nice if you open a new issue where we can track your issue separately.

that said, if you are seeing same memory issue. you can try either nodeExecutable or NODE_OPTIONS or python.analysis.exclude depends on your situation.

by the way, 4GB limitation is enforced by vscode, not something we can change.

heejaechang avatar May 02 '24 18:05 heejaechang

vscode-server might use different custom version of node than vscode that has different memory limitation.

can you try this trick by puting this in env var for your remote host?

export NODE_OPTIONS="--max-old-space-size=8192" or set NODE_OPTIONS=--max-old-space-size=8192 if you are using windows.

make sure this is set on terminal vscode-server runs before vscode-server runs

  • the 8192 is max memory in megabytes that is allowed node to consume. you can try different number if you want.

Thanks, @heejaechang , this helped. I set it in our devcontainer.json like

    "remoteEnv": {
        "NODE_OPTIONS": "--max-old-space-size=8192"
    },

We might hit the 8GB boundary in a couple of months or years but I hope that until then you might have figured out why the memory usage monitoring mentioned in this similar issue doesn't work.

Thanks for your suggestion!

clssn avatar May 22 '24 19:05 clssn

closing it as a dup of https://github.com/microsoft/pylance-release/issues/5925

I am using that issue to track how to use exclude in code-workspace file for individual workspace

heejaechang avatar Jun 25 '24 17:06 heejaechang