Does @ObservedResults async-open Realm?

During the initial sync after user logins, the app sometimes crashes after 10~20 seconds due to “terminating with uncaught exception of type realm::AddressSpaceExhausted: mmap() failed: Cannot allocate memory size: 26279936 offset: 134217728”

I removed all the occurrences of realm() that is opened synchronously after seeing this issue: Crash: malloc: can't allocate region / realm::AddressSpaceExhausted · Issue #7040 · realm/realm-swift · GitHub but still couldn’t avoid it.

I now suspect maybe it is the @ObservedResults that is trying to hold on to a lot of items in memory?

Hi @Siwei_Kang. To help your issue further please fill out the issue template on the Realm-Swift repo

Be sure to let us know when that’s been posted as I would like to duplicate the issue.

done. Does @ObservedResults async-open Realm? · Issue #7622 · realm/realm-swift · GitHub