Right now synchronous RealmQueries (with multiple sort fields on 35k objects) are slowing down my main thread, even after their Activity
was closed.
Currently I cannot use asynchronous queries due to a BadVersionException
, I have not yet figured out why.
Anyway, there is no way to stop these RealmResults
from auto-updating and blocking the main thread without closing the associated Realm
, right?
I hoped I would be able to use just one global Realm
instance, but this seems to leave me unable to stop mentioned RealmResults
until I hit the GC button in the Android Monitor to force garbage collection on the RealmResults
.
I did want to use just one Realm
instance since it was recommended by an iOS colleague to hopefully fix the BadVersionException
(for more on the BadVersionException
I already have another question open).
Should I continue to focus on fixing the issue that prevents me from using asynchronous queries, or is there something that I did not consider that could help me to at least temporarly migitate slow synchronous queries that keep blocking the main thread?
It is not hard to explain that queries on the data are slowing down the UI and we are working on moving them into the background, however, it is hard to explain that queries on a screen that is not open are still slowing down the main thread.