denops.vim icon indicating copy to clipboard operation
denops.vim copied to clipboard

There seems to be a memory leak in the denops server

Open Warashi opened this issue 8 months ago • 3 comments

There seems to be a memory leak in the denops server

This is all that init.vim does

let g:denops_server_addr = '127.0.0.1:32123'
set runtimepath+=~/.cache/nvim/dein/repos/github.com/vim-denops/denops.vim

The shared server startup command is this

❯ pwd
/home/ubuntu/.cache/nvim/dein/repos/github.com/vim-denops/denops.vim
❯ deno run -A --no-lock . /denops/@denops-private/cli.ts
Listen denops clients on 127.0.0.1:32123

This is the version of deno

❯ deno --version
deno 1.37.1 (release, aarch64-unknown-linux-gnu)
v8 11.8.172.6
typescript 5.2.2

The result of :checkhealth denops

denops: health#denops#check

- Supported Deno version: `1.32.0`
- Detected Deno version: `1.37.1`
- OK Deno version check: passed
- Supported Neovim version: `0.8.0`
- Detected Neovim version: `0.10.0`
- OK Neovim version check: passed
- Denops status: `running`
- OK Denops status check: passed

The result of :version

:version
NVIM v0.10.0-dev-7e94074
Build type: Release
LuaJIT 2.1.1693350652
Run ":verbose version" for more info

How to check reproduction

Repeat starting and stopping nvim while watching the memory usage of the shared server with htop

Warashi avatar Oct 07 '23 11:10 Warashi

commit hash of denops.vim is this

❯ pwd
/home/ubuntu/.cache/nvim/dein/repos/github.com/vim-denops/denops.vim
❯ git rev-parse HEAD
68f607d93a9758d15c0d63d3268aa420ddd29edd

Warashi avatar Oct 07 '23 11:10 Warashi

example of RSS change is below

  1. initial usage: 51804
  2. start nvim: moving around 59012 - 59748
  3. close nvim: 61164
  4. start nvim: moving around 60884 - 62312
  5. close nvim: 61762
  6. start nvim: moving around 61544 - 62548
  7. close nvim: 61508

P.S. using my usual configuration, example of RSS change is below

  1. initial usage: 50572
  2. start and close nvim: 124M
  3. start and close nvim: 183M
  4. start and close nvim: 215M
  5. start and close nvim: 232M

Warashi avatar Oct 07 '23 12:10 Warashi

📝

I'm not entirely certain, but it appears that this could be an issue with Deno itself. I'd like to express my gratitude to @Warashi for conducting a thorough investigation. It's possible that the following issues are related.

https://github.com/denoland/deno/issues/18414 https://github.com/denoland/deno/issues/8327 https://github.com/denoland/deno/issues/6946 https://github.com/denoland/deno/issues/6116

lambdalisue avatar Oct 10 '23 04:10 lambdalisue