Memory leak when using multiple carets
- OS version: Linux
- Editor: IntelliJ
- Editor version: 2022.1.4
- Programming language: Java
- TabNine extension version: 0.7.20
- Engine version : 4.4.120-48
Issue Details:
I'm able to reliably reproduce a memory leak in the TabNine binary used by tabnine-intellij. I have confirmed that the memory is used by the binary, not by the plugin.
Specifically, accepting a suggestion when using a large number of carets (~30) causes Tabnine to leak a large amount of memory. The amount of memory leaked seems to increase with each action. I have seen it leak as much as 9.6GB from a single action.
I've also seen memory leaked when undoing actions that used a large number of carets.
Interestingly, while this memory usage does show up in the output of free, it does not under either "VIRT" or "RES" memory in htop. However, it is all freed when TabNine is killed.
gz#17223
Hey @mpfaff
Thanks for reporting this!
I tried to reproduce it locally but failed - I'm using Ubuntu 20, IJ Ultimate 2022.1.4 and the specified binary and plugin versions. I edited Java files, accepting completions with multiple-caret mode with ~30 caret as stated in the issue, but couldn't see any abnormalities when running free -h -s1, and the System Monitor didn't show any excessive memory usage by the binary process.
Can you please attach the following:
- Your config file, the path of which can be found in the Hub -> Support -> General Info -> Config file path
- A video screenshot of how you reproduce the issue
- Specific commands / screenshots of where you see the memory leakage If you don't feel comfortable sharing it here you're welcome to open a ticket at [email protected]
Thanks a lot and have a nice day! Yoni
I'm going to be away for the week but I'll get you a video of the issue once I'm back. If I can reproduce it in a fresh project I'll link a video of it here, otherwise I'll open a ticket as suggested.
In the meantime, here's my config (with all tokens removed):
{
"version": "4.4.29",
"hide_promotional_message": false,
"beta_enabled": "Yes",
"ignore_all_lsp": false,
"semantic_status": {
"rust": "Enabled"
},
"enable_telemetry": false,
"user_understands_that_enabling_tabnine_cloud_sends_code_to_tabnine_servers": true,
"deep_completions_work_mode": "LocalOnly",
"hosted_deep_completions_enabled": "Disabled",
"tabnine_cloud_host": null,
"tabnine_cloud_certificate_domain": null,
"tabnine_cloud_port": null,
"cloud_whitelist": [],
"num_of_suggestions": 5,
"line_suggestions": true,
"omit_prefix_suggestions": false,
"api_base_url": null,
"binary_update_interval_seconds": null,
"local_enabled": "Unset",
"disable_local_when_using_battery": false,
"hide_deep_information_message": false,
"enable_power_saving_mode": false,
"rate_limit_interval_seconds": null,
"rate_limit_amount": null,
"generation": 48,
"local_model_size": "Medium",
"model_hash_override": null,
"local_indexing": null,
"heartbeat_interval_seconds": null,
"last_service_level": "Cloud",
"override_beams": null,
"override_context_length": null,
"onboarding": {
"model_type": null,
"skipped_login": false,
"completed": false
},
"has_git_repos": true,
"gusr": {
},
"exclude_file_masks": {
"masks": [
]
},
"inline_suggestions_mode": true,
"use_specialized_model_if_available": true,
"empty_line_suggestions": false,
"snippets_enabled_v2": true,
"inline_suggestions_mode_clients": null,
"tabnine_hub_port": null,
"manually_selected_model": null
}
Additionally, I am able to see the memory usage increasing when I run free -h manually, in the system memory usage in htop, and in the memory usage displayed in my status bar.
@mpfaff thanks for the info, have fun while you're away 🙂 I'm looking forward to the video, and I'd actually like to see your tokens removed from the config if possible, in order to find you in our systems and maybe get a lead from there.
~Of course I understand that you removed them from here on a public issue, so if you don't mind opening a ticket at [email protected] I'd appreciate it very much!~
Edit:
No need for now 😄
If you don't want to do so, a video attachment / a specific project + a set of actions to reproduce will do just fine 🙂
Thanks a lot for your cooperation!
Hey @mpfaff, forgot to ask you - Is there a chance that you're able to reproduce it in a project that's not a git repository? Tabnine locally indexes your project, and sometimes it fails to find a proper root for the project and ends up with excessive indexing - which can greatly affect your memory usage.
If you copy the file in which you were able to reproduce the issue into a small git folder - is this still reproduces?
Kind regards, Yoni
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.