TabNine icon indicating copy to clipboard operation
TabNine copied to clipboard

Extremely high memory and CPU usage

Open nodingneu opened this issue 6 years ago • 36 comments

I use TabNine in vim.

When I start vim (with simply vim, empty editor), the TabNine process is created and consumes 1.37 GB of memory.

That seems insane already.

For every couple seconds spent "editing" (typing random english sentences that pop into my head into the file), the memory usage increases by 0.05 GB.

Also the CPU usage is consistently >600% while editing.

Here's a video of me spewing stream of consciousness:

https://youtu.be/FgMe6ejqkhQ

Whirring fans is annoying. I have only used tabnine for less than a day so am not completely familiar with its problems, but these couple things were glaringly obvious to me once my computer became generally unresponsive by simply leaving a couple vim sessions open in the background.

nodingneu avatar Oct 31 '19 17:10 nodingneu

It seems reasonable as the local model is larger than 600MB, running such a model in a local environment that requires 1.37GB memory seems not very weird.

dreamyang-liu avatar Nov 03 '19 07:11 dreamyang-liu

I'm also getting >800% CPU spikes on a 12 core machine and ~1.6Gb memory use in VSCode :

Version: 1.38.1 Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0 Date: 2019-09-16T10:22:16.623Z Electron: 4.2.11 Chrome: 69.0.3497.128 Node.js: 10.11.0 V8: 6.9.427.31-electron.0 OS: Linux x64 4.14.149-1-MANJARO

ammkrn avatar Nov 03 '19 18:11 ammkrn

You can disable Tabnine local feature by Tabnine::config.

Shougo avatar Nov 03 '19 22:11 Shougo

Disabling TabNine local just stops TabNine from working at all, it's forever Establishing connection to TabNine Cloud...

Oh, because of #120

nodingneu avatar Nov 04 '19 06:11 nodingneu

I am also affected by this. At times my entire computer freezes.

skorokithakis avatar Nov 12 '19 17:11 skorokithakis

I also want to jump in. I absolutely love this plugin. It's amazing! But it does take up a lot of memory and it sometimes makes VSCode feels slow even on my 16GB memory machine. I know it's not easy to just waive a hand and say "well, let's just get something that uses less memory" but it definitely is an issue. In the meantime, I'll still be using this plugin, but would love an option to use less memory even at an accuracy cost (again easier said than done).

Thank you!

vscode tabnine

thomashzhang avatar Nov 19 '19 23:11 thomashzhang

The first out of memory crash on my new PC with 64 GB RAM.

mmc_toqMXlW8QO

kmate95 avatar Dec 12 '19 22:12 kmate95

Suffering the same - is a shame, since otherwise is a great tool.

project-delphi avatar Jan 29 '20 02:01 project-delphi

Same for me, but even worse. Screenshot 2020-02-12 at 18 00 47

haiodo avatar Feb 14 '20 06:02 haiodo

Hi All, we have a fix in beta (version 2.3.4) for excessive CPU and memory consumption by TabNine. We'd appreciate it if you try it out and let us know if it solves the issue for you. To try the fix, you have to enable the beta version. Just open TabNine's config by typing TabNine::config in your editor, and then check both Update TabNine automatically and Receive beta releases of TabNine Then, restart your editor, and press TabNine::confiig to verify you have TabNine 2.3.4. or newer. Please let us know if this version solves the problem for you. We plan to make it available to all users in a couple of weeks.

drorweiss avatar Feb 16 '20 05:02 drorweiss

@drorweiss how i update this in vscode?

kivervinicius avatar Mar 09 '20 12:03 kivervinicius

It is now released to all users and should update automatically. Type TabNine::version to see your version number - It should be 2.3.7 or later. See screenshot: image

drorweiss avatar Mar 09 '20 12:03 drorweiss

@drorweiss ok, thanks, on my computer still uses 2.5 g

kivervinicius avatar Mar 09 '20 12:03 kivervinicius

Hi, everyone who wrote on this issue.

We have since released a version that should improve TabNine's cpu and memory consumption. Would really appreciate your help in trying it out and seeing if the situation improved.

Thanks a lot!

amircodota avatar Mar 16 '20 13:03 amircodota

As you can see my version:

image

Memory consumption:

image

Environment: Ubuntu 19.10 Vscode: Version: 1.43.2 Commit: 0ba0ca52957102ca3527cf479571617f0de6ed50 Date: 2020-03-24T07:52:11.516Z Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Linux x64 5.3.0-42-generic

Xunjin avatar Mar 29 '20 14:03 Xunjin

perhaps the modes of TabNine should provided two version,large for huge memory machine, and smaller for lower machine. or optimize the mode to make it smaller.

shuxiao9058 avatar Mar 29 '20 17:03 shuxiao9058

@Xunjin and @shuxiao9058 Thank you for your feedback.

Memory footprint of 1.7GB is not uncommon when TabNine local is enabled. In fact, it can grow up to 2.5GB (depending on project size), but it should not grow much beyond that. Before it could grow without bounds, as one of the reports above shows ~124GB (!!) RAM.

If you do not wish to use that much RAM, you can disable deep TabNine local, which is responsible for most of the memory usage. If you still wish to receive deep suggestions, you can choose to use TabNine cloud (a paid option).

amircodota avatar Mar 29 '20 18:03 amircodota

@amircodota No problem, just saw that you tagged a help wanted, so came for help (I guess).

IMHO the tools seems way better than before, In the past had some huge CPU spikes which doesn't happen quite often.

@shuxiao9058 pointed in other issues that could be other optimizations, it's not everybody who has powerful machines or/and have available 2.5 GB just for TabNine... Maybe it's worth looking for it ?!

Well, that's my 2 cents :)

Xunjin avatar Mar 30 '20 16:03 Xunjin

@Xunjin Thanks for the feedback.

We are definitely looking into ways of reducing the memory footprint. Stay tuned...

amircodota avatar Mar 30 '20 18:03 amircodota

Got this issue, after upgraded to the latest MacOS 10.15.4. Only open one VS code window and one project. It will get high MEM while typing several code lines. Hope it will be fixed.

image

image

easonlau02 avatar Apr 11 '20 06:04 easonlau02

@amircodota if any solution for it, my highly configured Mac is running with high MEM.

easonlau02 avatar Apr 16 '20 06:04 easonlau02

Hi @easonlau02

See above comment

amircodota avatar Apr 16 '20 10:04 amircodota

This is still an issue. I have node_modules listen in .gitignore but it still chonks up my CPU and RAM like crazy. And by CPU Usage I mean 100% CPU usage every time I try to write. This doesn't occur when I'm working with non-npm/node projects.

HenrijsS avatar Apr 24 '20 12:04 HenrijsS

@HenrijsS

A few questions:

  1. What editor are you using?
  2. Do you have tabnine local enabled? If so, can you disable and see if it still reproduces?
  3. Is your project open source by any chance? Would love to get the code and try to reproduce

amircodota avatar Apr 24 '20 18:04 amircodota

@HenrijsS

A few questions:

  1. What editor are you using?
  2. Do you have tabnine local enabled? If so, can you disable and see if it still reproduces?
  3. Is your project open source by any chance? Would love to get the code and try to reproduce
  1. Visual Studio Code
  2. I only use TabNine local because I'm currently a free user.
  3. Unfortunately no, it is a private project for a client.

HenrijsS avatar Apr 24 '20 20:04 HenrijsS

@HenrijsS would it be possible for us to get the package.json file only, along with relevant lock files (yarn.lock or package-lock.json), so that we can create a similar project?

amircodota avatar Apr 26 '20 08:04 amircodota

How do I disable it per project? I only need auto complete on my "main" the other VScode instances are just to browse code. That would fix the insane memory hogging for me

Elyx0 avatar Jul 12 '20 17:07 Elyx0

Is there any progress on reducing RAM usage for TabNine? I'm on 2.8.1 and it normally used between 1.2gb and 1.5gb. Using Atom

Thanks Dom

dominicboston avatar Jul 14 '20 22:07 dominicboston

I really enjoyed the tabnine concept, but as well pointed here, it is a huge memory hog. I have 16gb of ram, but as a developer we keep so many things opened which has a huge impact. I've disabled it for not (haven't uninstalled) hopping this issue could be addressed.

DevCentre avatar Aug 03 '20 14:08 DevCentre

After thinking my problem was too many Google Chrome windows/tabs open I started looking into my Neovim/Vim as the culprit because my machine ends up becoming unresponsive when editing code. I'm thinking this is hitting me pretty hard and I'm finding it pretty much a killer for my productivity, outweighing the benefits. Seems like there should be a way to restrict the amount of CPU it can use.

timnolte avatar Sep 28 '20 19:09 timnolte