I’m confuse with a behaviour im observing at realm (swift).
So from beginning, I got this error
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=9 "mmap() failed: Cannot allocate memory size: 45088768 offset
i found out this might be related to ios limitations on memory allocation due the way realm works here.
https://github.com/realm/realm-swift/issues/6431
So I’ve decided to create a stress test to test my solution.
Current situation:
I’ve added this code
DispatchQueue(label: "filldatabase").async {
while true {
let data : myDataClass = myDataClass.generateFakeData() as! myDataClass
Services.persistence.store(data: data, timestamp: Date()) // save to realm
}
}
I’m observing a weird behaviour here… seems like I’m able to create something like “500” entries in the database but then i get a crash with ‘The Realm is already in a write transaction’
this doesnt seem to make much sense… why does it crash after being sucessfull on adding something like “500” entries , whats different on entry “501”? is there any limitation im missing?