kiteco / issue-tracker

User-reported issues for Kite
https://Kite.com
1.75k stars 136 forks source link

Kite Engine shutdown #580

Open Spurlos opened 3 years ago

Spurlos commented 3 years ago

I have noticed that Kite engine executable is still running in the background when I exit IDE.

It would nice to have a setting in Kite to auto-shutdown its daemon process if no IDE with installed plugin is running (e.g check every 15-30 sec for keep alive signal).

Currently I have to kill the engine each time I exit IDE, to recover some memory (up to 1 GB on 16 GB system, not mentioning swap). I think its rude to take RAM hostage when the process isn't used at all.

OS: Ubuntu 20.10

metalogical commented 3 years ago

Kite should free up memory automatically when it goes idle for 15-30 minutes. Is this not what you experience?

If not, it would be very helpful to send us a memory profile (https://help.kite.com/article/96-contact-us-with-logs) and then share it here. Please generate the profile after letting Kite idle for 15-30 minutes, as that will allow us to see what exactly is consuming so much memory.

Spurlos commented 3 years ago

Memory stats right after IDE shutdown (after a typical workday): Screenshot from 2021-02-12 01-37-35

Memory stats an ~hour later: Screenshot from 2021-02-12 02-34-49

Logs: https://s3.console.aws.amazon.com/s3/object/kite-client-logs/prod/ebb5ec9e-052e-44de-b86b-8d0eb11408e9/kite_local/client.log.2021-02-12_02-35-49-AM.bak.gz https://s3.console.aws.amazon.com/s3/object/kite-client-capture/prod/ebb5ec9e-052e-44de-b86b-8d0eb11408e9/kite_local/1613090155607908670/capture.gz

kited process remained in memory and even got some swapped pages back into RAM.

Ideally I would prefer it to shutdown ASAP after IDE closure, as I may not re-launch IDE for the remainder of user session (e.g play some games, shutdown the PC and return to kite assisted coding the next day)

howdev commented 3 years ago

yes I experienced same issue on Ubuntu based Linux. Kited keeps running and does not release memory when there is no editor running. I need to end the process from the system monitor. The RAM keeps going up. and there are so many tail -1 processes. Kite daemon does not need to keep the models in RAM when the editor is closed. It should release straight away. If the editor is still running and no coding, then use a very short idle time not 15-30mins, because when you need to browse or watch some video or do some other task, you need the RAM for those. If every daemon behave like this no RAM is enough. I turn on the computer next morning and kited is still not releasing the memory.

metalogical commented 3 years ago

@howdev would you mind attaching memory profiles as well? This is definitely not expected behavior, and it's challenging to track down the issue.

Regarding automatically exiting Kite, that one requires a bit more product thought, since Kite currently has a multi-tenant architecture, so we need to ensure we can reliably detect when all clients are terminated.

howdev commented 3 years ago

there is another report on same issue #497 I put in the resource log there, I also copy it here.

https://s3.console.aws.amazon.com/s3/object/kite-client-capture/prod/6567a28b-0f73-4808-bb23-264d43996be1/kite_local/1614033239578907482/capture.gz