In my app, I have a problem with the memory.
If I write ref.getDocuments()
everything works fine. The memory stay at 40mo. However, if I add .whereField("movementID", isEqualTo: PRID)
the memory go from 40mo to more than 1Go ...
ref.whereField("movementID", isEqualTo: PRID).getDocuments() { (querySnapshot, err) in
if let err = err {
print("Error getting documents: \(err)")
} else {
if querySnapshot!.isEmpty {
print("EMPTY")
}
for document in querySnapshot!.documents {
let dict = document.data()
}
}
}
I call this function multiple times, so if the function is called 15-20 times the memory goes to 1Go, but if it's more, the app crash.
Do you have an idea about why there is this memory issue, and how I could correct the problem?