While performing the query operation, I’m performing a memory issue and OS terminate the application. Limiting the processing count up 20,000 works fine. But if anything other than that makes the problem.
Couchbase verison
pod ‘couchbase-lite-ios/SQLCipher’, ‘1.4.1’
Actually, I’m looking into existing code to resolve this issue. And am a bit new to couchbase. Below given the piece of code causing the issue.
let database = try Couchbase.openDatabase(databaseName: databaseName)
database.manager.backgroundTellDatabaseNamed(database.name) { database in
guard let query = database.existingViewNamed(viewName)?.createQuery() else {
callback(nil)
return
}
query.prefetch = true
do {
// query.limit = 20000
let documents = try query.run().compactMap({$0 as? CBLQueryRow}).compactMap({$0.document}) // Here we are watching the issue
callback(documents)
} catch {
callback(nil)
}
If anyone has this experience, please share and that would be very helpful.