Closed ViugiNick closed 11 months ago
@ViugiNick Please send us the logs files, see here how to do that
This bug is based on the Android Studio memory usage reporting, so we dont have access to idea.log files.
@ViugiNick Can you send us the engine log file? see here how to do that
@TzufTabnine Unfortunately we don't have a scenario to reproduce this problem locally, so we can't attach the engine log file too. I think I found the place where this memory leak may happen:
ApplicationManager.getApplication()
.getMessageBus()
.connect(this)
.subscribe(
LimitedSecletionsChangedNotifier.LIMITED_SELECTIONS_CHANGED_TOPIC,
limited -> {
this.isLimited = limited;
update();
});
Here the registered message handler holds a reference to a TabnineStatusBarWidget that may become disposed before before the message is processed.
@TzufTabnine Unfortunately we don't have a scenario to reproduce this problem locally, so we can't attach the engine log file too. I think I found the place where this memory leak may happen:
ApplicationManager.getApplication() .getMessageBus() .connect(this) .subscribe( LimitedSecletionsChangedNotifier.LIMITED_SELECTIONS_CHANGED_TOPIC, limited -> { this.isLimited = limited; update(); });
Here the registered message handler holds a reference to a TabnineStatusBarWidget that may become disposed before before the message is processed.
Can't say that you are wrong, but I am almost sure that the subscribed handlers to a connection are disposed/garbage collected once the connection was disposed.
From the documentation of connect
Allows to create new connection that is bound to the given Disposable. That means that returned connection will be automatically released if given disposable parent is collected.
Params:
parentDisposable – target parent disposable to which life cycle newly created connection shall be bound
@ofekby Thanks for your comment. You are absolutely right, in that case it seems like in this case disposed MessageBusConnectionImpl
should be removed from the subscribers
queue. But according to the reports it remained there for an extra hour. Will file a youtrack bug for it
Lambda in TabnineStatusBarWidget holds disposed TabnineStatusBarWidget and disposed ProjectImpl which leads to a memory leak
gz#28404
(related to Zendesk ticket #28404)