realm-kotlin icon indicating copy to clipboard operation
realm-kotlin copied to clipboard

Use GC to close `RealmReference`s

Open clementetb opened this issue 1 year ago • 1 comments

Currently, we use the VersionTracker to close realms whose RealmReferences that have been claimed by the GC.

This has two effects: first versions will not be reclaimed until there is some version advancement; second, closing realms would be done in the notifier/writer threads, instead of using the GC collector.

We should explore moving close and let the GC thread close and reclaim realms.

clementetb avatar Sep 25 '23 12:09 clementetb

Hmm, not sure I agree with this. Having a deterministic lifecycle for these versions is pretty nice and makes it easier to reason about what is happening. But we can discuss it.

cmelchior avatar Sep 26 '23 12:09 cmelchior