jupyter-server / jupyter_server

The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications.
https://jupyter-server.readthedocs.io
BSD 3-Clause "New" or "Revised" License
481 stars 293 forks source link

Jupyter Server RAM footprint increases with usage- Shut Down not working properly #1235

Open adalseno opened 1 year ago

adalseno commented 1 year ago

Description

Hi, I have Jupyterlab 3.6.1 running on Mac Os 10.15.7 (iMac i7, with 32GB RAM), Python 3.10.9, Jupyter server 2.3.0 in a miniconda environment, and I access it remotely using Chrome. When I started the server, it used about 180 Mb of RAM, but after some time and usage, with all kernels and terminals correctly closed, the footprint increased (it arrived at 879 Mb), and I had to restart the server. Furthermore, when I Shut Down the server via the Jupyterlab File menu, it doesn't shut it down properly, and I cannot reconnect. I must connect via ssh and kill the old process (the service on Mac Os is set to KeeAlive, so as soon as I kill the process, it will reload, and I can connect). The issue was not present before the latest update (I'm sorry, I can't remember the previous version number). Is it normal? I tried the %reset magic, but it has no effect.

Reproduce

  1. Go to 'File'
  2. Click on 'Shut Down'

Expected behavior

The server should shut down and automatically restart. Memory usage should not increase over time.

Context

Output from the terminal:

❯ ps axu | grep python
andrea           66967   2.3  0.4  6091616 144024   ??  S     5:12PM   0:02.34 /Users/andrea/miniconda/bin/python3.10 /Users/andrea/miniconda/bin/jupyter-server --config /Users/andrea/.jupyter/jupyter_server_config.py --no-browser
andrea           67819   0.0  0.0  4399300    728 s001  S+    5:13PM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox python

❯ kill -9 66967
❯ ps axu | grep python
andrea           67820   2.3  0.4  5566828 136652   ??  S     5:14PM   0:01.52 /Users/andrea/miniconda/bin/python3.10 /Users/andrea/miniconda/bin/jupyter-server --config /Users/andrea/.jupyter/jupyter_server_config.py --no-browser
andrea           67846   0.0  0.0  4399300    728 s001  S+    5:14PM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox python

Package list:

Name Version Build Channel

_r-mutex 1.0.1 anacondar_1 conda-forge aiofiles 22.1.0 pyhd8ed1ab_0 conda-forge aiosqlite 0.18.0 pyhd8ed1ab_0 conda-forge anyio 3.6.2 pyhd8ed1ab_0 conda-forge appnope 0.1.3 pyhd8ed1ab_0 conda-forge argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge argon2-cffi-bindings 21.2.0 py310h90acd4f_3 conda-forge arrow 1.2.3 pypi_0 pypi asttokens 2.2.1 pyhd8ed1ab_0 conda-forge attrs 22.2.0 pyh71513ae_0 conda-forge babel 2.12.1 pyhd8ed1ab_1 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 pyhd8ed1ab_3 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge beautifulsoup4 4.11.2 pyha770c72_0 conda-forge black 23.1.0 py310h2ec42d9_0 conda-forge bleach 6.0.0 pyhd8ed1ab_0 conda-forge brotli 1.0.9 hb7f2c08_8 conda-forge brotli-bin 1.0.9 hb7f2c08_8 conda-forge brotlipy 0.7.0 py310h90acd4f_1005 conda-forge bwidget 1.9.14 h694c41f_1 conda-forge bzip2 1.0.8 h0d85af4_4 conda-forge c-ares 1.18.1 h0d85af4_0 conda-forge ca-certificates 2022.12.7 h033912b_0 conda-forge cairo 1.16.0 h904041c_1014 conda-forge cctools_osx-64 973.0.1 h48a5a9d_11 conda-forge certifi 2022.12.7 pyhd8ed1ab_0 conda-forge cffi 1.15.1 py310ha78151a_3 conda-forge charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge clang 14.0.4 h694c41f_0 conda-forge clang-14 14.0.4 default_h55ffa42_0 conda-forge clang_osx-64 14.0.4 h3a95cd4_2 conda-forge clangxx 14.0.4 default_h55ffa42_0 conda-forge clangxx_osx-64 14.0.4 he1dbc44_2 conda-forge click 8.1.3 unix_pyhd8ed1ab_2 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge comm 0.1.2 pyhd8ed1ab_0 conda-forge compiler-rt 14.0.4 h7fcd477_0 conda-forge compiler-rt_osx-64 14.0.4 h6df654d_0 conda-forge conda 23.1.0 py310h2ec42d9_0 conda-forge conda-libmamba-solver 23.1.0 pyhd8ed1ab_0 conda-forge conda-package-handling 2.0.2 pyh38be061_0 conda-forge conda-package-streaming 0.7.0 pyhd8ed1ab_1 conda-forge contourpy 1.0.7 py310ha23aa8a_0 conda-forge cryptography 39.0.2 py310hdd0c95c_0 conda-forge curl 7.88.1 h6df9250_0 conda-forge cycler 0.11.0 pyhd8ed1ab_0 conda-forge debugpy 1.6.6 py310h7a76584_0 conda-forge decorator 5.1.1 pyhd8ed1ab_0 conda-forge defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge entrypoints 0.4 pyhd8ed1ab_0 conda-forge executing 1.2.0 pyhd8ed1ab_0 conda-forge expat 2.5.0 hf0c8a7f_0 conda-forge flit-core 3.8.0 pyhd8ed1ab_0 conda-forge fmt 9.1.0 hb8565cd_0 conda-forge font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge font-ttf-inconsolata 3.000 h77eed37_0 conda-forge font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge font-ttf-ubuntu 0.83 hab24e00_0 conda-forge fontconfig 2.14.2 h5bb23bf_0 conda-forge fonts-conda-ecosystem 1 0 conda-forge fonts-conda-forge 1 0 conda-forge fonttools 4.39.0 py310h90acd4f_0 conda-forge fqdn 1.5.1 pypi_0 pypi freetype 2.12.1 h3f81eb7_1 conda-forge fribidi 1.0.10 hbcb3906_0 conda-forge gettext 0.21.1 h8a4c099_0 conda-forge gfortran_impl_osx-64 11.3.0 h1f927f5_30 conda-forge gfortran_osx-64 11.3.0 h18f7dce_0 conda-forge gitdb 4.0.10 pyhd8ed1ab_0 conda-forge gitpython 3.1.31 pyhd8ed1ab_0 conda-forge gmp 6.2.1 h2e338ed_0 conda-forge graphite2 1.3.13 h2e338ed_1001 conda-forge gsl 2.7 h93259b0_0 conda-forge harfbuzz 6.0.0 h08f8713_0 conda-forge icu 70.1 h96cf925_0 conda-forge idna 3.4 pyhd8ed1ab_0 conda-forge importlib-metadata 6.0.0 pyha770c72_0 conda-forge importlib_metadata 6.0.0 hd8ed1ab_0 conda-forge importlib_resources 5.12.0 pyhd8ed1ab_0 conda-forge ipykernel 6.21.2 pyh736e0ef_0 conda-forge ipympl 0.9.3 pyhd8ed1ab_0 conda-forge ipython 8.11.0 pyhd1c38e8_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 8.0.4 pyhd8ed1ab_0 conda-forge isl 0.25 hb486fe8_0 conda-forge isoduration 20.11.0 pypi_0 pypi isort 5.12.0 pyhd8ed1ab_1 conda-forge jedi 0.18.2 pyhd8ed1ab_0 conda-forge jinja2 3.1.2 pyhd8ed1ab_1 conda-forge jpeg 9e hb7f2c08_3 conda-forge json5 0.9.5 pyh9f0ad1d_0 conda-forge jsonpointer 2.3 pypi_0 pypi jsonschema 4.17.3 pyhd8ed1ab_0 conda-forge jupyter-resource-usage 0.7.2 pypi_0 pypi jupyter-server-mathjax 0.2.6 pyh5bfe37b_1 conda-forge jupyter_client 8.0.3 pyhd8ed1ab_0 conda-forge jupyter_core 5.2.0 py310h2ec42d9_0 conda-forge jupyter_events 0.6.3 pyhd8ed1ab_0 conda-forge jupyter_server 2.3.0 pyhd8ed1ab_0 conda-forge jupyter_server_fileid 0.8.0 pyhd8ed1ab_0 conda-forge jupyter_server_terminals 0.4.4 pyhd8ed1ab_1 conda-forge jupyter_server_ydoc 0.6.1 pyhd8ed1ab_0 conda-forge jupyter_ydoc 0.2.2 pyhd8ed1ab_0 conda-forge jupyterlab 3.6.1 pyhd8ed1ab_0 conda-forge jupyterlab-code-formatter 1.5.3 pypi_0 pypi jupyterlab-git 0.41.0 pyhd8ed1ab_1 conda-forge jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge jupyterlab_server 2.20.0 pyhd8ed1ab_0 conda-forge jupyterlab_widgets 3.0.5 pyhd8ed1ab_0 conda-forge kiwisolver 1.4.4 py310ha23aa8a_1 conda-forge krb5 1.20.1 h049b76e_0 conda-forge lcms2 2.15 h29502cd_0 conda-forge ld64_osx-64 609 h1e06c2b_10 conda-forge lerc 4.0.0 hb486fe8_0 conda-forge libarchive 3.6.2 h6d8d9f1_0 conda-forge libblas 3.9.0 16_osx64_openblas conda-forge libbrotlicommon 1.0.9 hb7f2c08_8 conda-forge libbrotlidec 1.0.9 hb7f2c08_8 conda-forge libbrotlienc 1.0.9 hb7f2c08_8 conda-forge libcblas 3.9.0 16_osx64_openblas conda-forge libclang-cpp14 14.0.4 default_h55ffa42_0 conda-forge libcurl 7.88.1 h6df9250_0 conda-forge libcxx 15.0.7 h71dddab_0 conda-forge libdeflate 1.17 hac1461d_0 conda-forge libedit 3.1.20191231 h0678c8f_2 conda-forge libev 4.33 haf1e3a3_1 conda-forge libffi 3.4.2 h0d85af4_5 conda-forge libgfortran 5.0.0 12_2_0_h97931a8_30 conda-forge libgfortran-devel_osx-64 11.3.0 h824d247_28 conda-forge libgfortran5 12.2.0 he409387_30 conda-forge libglib 2.74.1 h4c723e1_1 conda-forge libiconv 1.17 hac89ed1_0 conda-forge liblapack 3.9.0 16_osx64_openblas conda-forge libllvm14 14.0.4 h41df66c_0 conda-forge libllvm15 15.0.7 h7001e86_0 conda-forge libmamba 1.3.1 h9d281b0_2 conda-forge libmambapy 1.3.1 py310hb15139c_2 conda-forge libnghttp2 1.52.0 he2ab024_0 conda-forge libopenblas 0.3.21 openmp_h429af6e_3 conda-forge libpng 1.6.39 ha978bb4_0 conda-forge libsodium 1.0.18 hbcb3906_1 conda-forge libsolv 0.7.23 hbc0c0cd_0 conda-forge libsqlite 3.40.0 ha978bb4_0 conda-forge libssh2 1.10.0 h47af595_3 conda-forge libtiff 4.5.0 hee9004a_2 conda-forge libwebp-base 1.2.4 h775f41a_0 conda-forge libxcb 1.13 h0d85af4_1004 conda-forge libxml2 2.10.3 hb9e07b5_0 conda-forge libzlib 1.2.13 hfd90126_4 conda-forge llvm-openmp 15.0.7 h61d9ccf_0 conda-forge llvm-tools 14.0.4 h41df66c_0 conda-forge lz4-c 1.9.4 hf0c8a7f_0 conda-forge lzo 2.10 haf1e3a3_1000 conda-forge make 4.3 h22f3db7_1 conda-forge markupsafe 2.1.2 py310h90acd4f_0 conda-forge matplotlib-base 3.7.1 py310he725631_0 conda-forge matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge mistune 2.0.5 pyhd8ed1ab_0 conda-forge mpc 1.3.1 h81bd1dd_0 conda-forge mpfr 4.1.0 h0f52abe_1 conda-forge munkres 1.1.4 pyh9f0ad1d_0 conda-forge mypy_extensions 1.0.0 pyha770c72_0 conda-forge nbclassic 0.5.3 pyhb4ecaf3_3 conda-forge nbclient 0.7.2 pyhd8ed1ab_0 conda-forge nbconvert 7.2.9 pyhd8ed1ab_0 conda-forge nbconvert-core 7.2.9 pyhd8ed1ab_0 conda-forge nbconvert-pandoc 7.2.9 pyhd8ed1ab_0 conda-forge nbdime 3.1.1 pyhd8ed1ab_0 conda-forge nbformat 5.7.3 pyhd8ed1ab_0 conda-forge nbresuse 0.4.0 pyhd8ed1ab_0 conda-forge ncurses 6.3 h96cf925_1 conda-forge nest-asyncio 1.5.6 pyhd8ed1ab_0 conda-forge notebook 6.5.2 pyha770c72_1 conda-forge notebook-shim 0.2.2 pyhd8ed1ab_0 conda-forge numpy 1.24.2 py310h788a5b3_0 conda-forge openjpeg 2.5.0 h13ac156_2 conda-forge openssl 3.0.8 hfd90126_0 conda-forge packaging 23.0 pyhd8ed1ab_0 conda-forge pandoc 2.19.2 h694c41f_2 conda-forge pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge pango 1.50.14 hbd9bf65_0 conda-forge parso 0.8.3 pyhd8ed1ab_0 conda-forge pathspec 0.11.0 pyhd8ed1ab_0 conda-forge pcre2 10.40 h1c4e4bc_0 conda-forge pexpect 4.8.0 pyh1a96a4e_2 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 9.4.0 py310h306a057_1 conda-forge pip 23.0.1 pyhd8ed1ab_0 conda-forge pixman 0.40.0 hbcb3906_0 conda-forge pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge platformdirs 3.1.0 pyhd8ed1ab_0 conda-forge pluggy 1.0.0 pyhd8ed1ab_5 conda-forge prometheus_client 0.16.0 pyhd8ed1ab_0 conda-forge prompt-toolkit 3.0.38 pyha770c72_0 conda-forge prompt_toolkit 3.0.38 hd8ed1ab_0 conda-forge psutil 5.9.4 py310h90acd4f_0 conda-forge pthread-stubs 0.4 hc929b4f_1001 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge pybind11-abi 4 hd8ed1ab_3 conda-forge pycosat 0.6.4 py310h90acd4f_1 conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pygments 2.14.0 pyhd8ed1ab_0 conda-forge pyopenssl 23.0.0 pyhd8ed1ab_0 conda-forge pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge pyrsistent 0.19.3 py310h90acd4f_0 conda-forge pysocks 1.7.1 pyha2e5f31_6 conda-forge python 3.10.9 he7542f4_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-fastjsonschema 2.16.3 pyhd8ed1ab_0 conda-forge python-json-logger 2.0.7 pyhd8ed1ab_0 conda-forge python-tzdata 2022.7 pyhd8ed1ab_0 conda-forge python.app 1.4 py310h90acd4f_1 conda-forge python_abi 3.10 3_cp310 conda-forge pytz 2022.7.1 pyhd8ed1ab_0 conda-forge pytz-deprecation-shim 0.1.0.post0 py310h2ec42d9_3 conda-forge pyyaml 6.0 py310h90acd4f_5 conda-forge pyzmq 25.0.0 py310hf615a82_0 conda-forge r-base 4.2.2 h841e2fe_3 conda-forge readline 8.1.2 h3899abd_0 conda-forge reproc 14.2.4 hb7f2c08_0 conda-forge reproc-cpp 14.2.4 hf0c8a7f_0 conda-forge requests 2.28.2 pyhd8ed1ab_0 conda-forge rfc3339-validator 0.1.4 pyhd8ed1ab_0 conda-forge rfc3986-validator 0.1.1 pyh9f0ad1d_0 conda-forge rpy2 3.5.8 py310r42h936d966_0 conda-forge ruamel.yaml 0.17.21 py310h90acd4f_3 conda-forge ruamel.yaml.clib 0.2.7 py310h90acd4f_1 conda-forge send2trash 1.8.0 pyhd8ed1ab_0 conda-forge setuptools 67.5.1 pyhd8ed1ab_0 conda-forge sigtool 0.1.3 h88f4db0_0 conda-forge simplegeneric 0.8.1 py_1 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge smmap 3.0.5 pyh44b312d_0 conda-forge sniffio 1.3.0 pyhd8ed1ab_0 conda-forge soupsieve 2.3.2.post1 pyhd8ed1ab_0 conda-forge sqlite 3.40.0 h9ae0607_0 conda-forge stack_data 0.6.2 pyhd8ed1ab_0 conda-forge tapi 1100.0.11 h9ce4665_0 conda-forge terminado 0.17.1 pyhd1c38e8_0 conda-forge tinycss2 1.2.1 pyhd8ed1ab_0 conda-forge tk 8.6.12 h5dbffcc_0 conda-forge tktable 2.10 h49f0cf7_3 conda-forge tomli 2.0.1 pyhd8ed1ab_0 conda-forge toolz 0.12.0 pyhd8ed1ab_0 conda-forge tornado 6.2 py310h90acd4f_1 conda-forge tqdm 4.65.0 pyhd8ed1ab_1 conda-forge traitlets 5.9.0 pyhd8ed1ab_0 conda-forge typing-extensions 4.4.0 hd8ed1ab_0 conda-forge typing_extensions 4.4.0 pyha770c72_0 conda-forge tzdata 2022g h191b570_0 conda-forge tzlocal 4.2 py310h2ec42d9_2 conda-forge unicodedata2 15.0.0 py310h90acd4f_0 conda-forge uri-template 1.2.0 pypi_0 pypi urllib3 1.26.14 pyhd8ed1ab_0 conda-forge wcwidth 0.2.6 pyhd8ed1ab_0 conda-forge webcolors 1.12 pypi_0 pypi webencodings 0.5.1 py_1 conda-forge websocket-client 1.5.1 pyhd8ed1ab_0 conda-forge wheel 0.38.4 pyhd8ed1ab_0 conda-forge widgetsnbextension 4.0.5 pyhd8ed1ab_0 conda-forge xorg-libxau 1.0.9 h35c211d_0 conda-forge xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge xz 5.2.6 h775f41a_0 conda-forge y-py 0.5.5 py310hb28ce15_2 conda-forge yaml 0.2.5 h0d85af4_2 conda-forge yaml-cpp 0.7.0 hf0c8a7f_2 conda-forge ypy-websocket 0.8.2 pyhd8ed1ab_0 conda-forge zeromq 4.3.4 he49afe7_1 conda-forge zipp 3.15.0 pyhd8ed1ab_0 conda-forge zlib 1.2.13 hfd90126_4 conda-forge zstandard 0.19.0 py310h3cf44b0_1 conda-forge zstd 1.5.2 hbc0c0cd_6 conda-forge

Screenshot 2023-03-07 19 00 00 The available memory says 16 GB just because I set that limit in the extension resource-usage

welcome[bot] commented 1 year ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada: