Rust-analyzer: High memory usage even when there is no coding activity

Created on 12 Jul 2020  路  3Comments  路  Source: rust-analyzer/rust-analyzer

While using coc.nvim + coc-rust-analyzer + rust-analyzer, I keep seeing high memory usage even when there is no coding activity.

    PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
  61986 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.00 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  61987 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.00 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  61990 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.27 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  61991 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.01 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  61992 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.00 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  61993 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.02 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  61994 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:35.12 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  61995 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.00 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  61996 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.00 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  61997 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.00 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  61998 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.00 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  62011 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.00 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  62014 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:00.00 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
  61985 cheng      20   0 2089M 1148M 12904 S  0.0 14.9  0:36.08 /home/cheng/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer

Most helpful comment

@matklad Thanks for making it clear that this will finally be fixed!

@lnicola This is not reasonable, many IDEs will not even take this amount of RAM, it will cause big problems to use rust-analyzer on laptops with 8G's RAM

All 3 comments

There's still some potential for reducing the memory usage, but probably not much low-hanging fruit. Still, at this point, 1.1 GB seems quite reasonable to me.

Also, note that your list shows threads, not processes, so it's not using 15 GB as it may seem.

Yes, at the moment rust-analyzer requires couple of gigabytes of RAM for medium sized projects. Will be fixed eventually.

@matklad Thanks for making it clear that this will finally be fixed!

@lnicola This is not reasonable, many IDEs will not even take this amount of RAM, it will cause big problems to use rust-analyzer on laptops with 8G's RAM

Was this page helpful?
0 / 5 - 0 ratings