Skip to content
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

restarting the Python Interactive kernel increases persistent memory usage #3171

Closed
rbavery opened this issue Aug 15, 2019 · 3 comments
Closed
Assignees

Comments

@rbavery
Copy link

rbavery commented Aug 15, 2019

Environment data

  • VS Code version: 1.37
  • Extension version (available under the Extensions sidebar): 2019.8.30787
  • OS and version: Ubuntu 18.04
  • Python version (& distribution if applicable, e.g. Anaconda): conda-forge 3.7.3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: XXX
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version vscode-python#3977): XXX

Expected behaviour

Wouldn't persistently increase memory use

Actual behaviour

When I restart the kernel in a Python Interactive session, my memory use goes up and stays up. If I restart a bunch of times in a row, it keeps going up. Only way to clear is to close vscode entirely. It goes up by about .08 Gb with each restart, which adds up quickly.

Steps to reproduce:

  1. start an interactive session, star restarting the kernel, and monitor the memory with htop

Logs

There was nothing in the logs

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

see attached, couldn't copy paste from dev tools screen. I've also included a gif showing the problem.

Selection_042

Peek 2019-08-14 19-26

@IanMatthewHuff
Copy link
Member

@rbavery. Thanks for the report on this. We made a change recently to our restart to always start up a second session under the hood to allow for a fast restarts. But it looks like on restart there are python processes building up and not being disposed of. I'll look into this.

@tigerhawkvok
Copy link

@IanMatthewHuff I can confirm this on my system -- I have a very memory intensive process that I wanted to dump, and on restarting the kernel it didn't dispose of the old process. I needed to manually kill the process.

image

Version: 1.37.1 (system setup)
Commit: f06011ac164ae4dc8e753a3fe7f9549844d15e35
Date: 2019-08-15T16:17:55.855Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.17763
Name: Python
Id: ms-python.python
Description: Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, and more.
Version: 2019.8.30787
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python

@mgsnuno
Copy link

mgsnuno commented Aug 23, 2019

I also confirm exactly the same issue on my system. I noticed the restarts getting faster, which is nice, but then I noticed a build up of processes.

Easy to reproduce:

  1. Start IPython interactive in VS Code
  2. run in Terminal pidof python
  3. restart IPython kernel x times
  4. run in Terminal pidof python and see x more processes

This has quite an impact while using dask for example, as the old cluster is not killed and the resources used by it are just stuck there.

@IanMatthewHuff IanMatthewHuff self-assigned this Aug 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants