Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

GC hints

laurensprieme60c2b1192ee
diff --git a/mobile/lib/db/ml/db.dart b/mobile/lib/db/ml/db.dart
index ab0a7759fa..4891d0de92 100644
--- a/mobile/lib/db/ml/db.dart
+++ b/mobile/lib/db/ml/db.dart
@@ -1222,6 +1222,9 @@ class MLDataDB with SqlDbBase implements IMLDataDB<int> {
final stopwatch = Stopwatch()..start();
try {
while (true) {
+ // Allow some time for any GC to finish
+ await Future.delayed(const Duration(milliseconds: 100));
+
final List<Map<String, dynamic>> results = await db.getAll('''
SELECT $fileIDColumn, $embeddingColumn
FROM $clipTable
@@ -1254,6 +1257,10 @@ class MLDataDB with SqlDbBase implements IMLDataDB<int> {
if (processedCount >= totalCount) {
break;
}
+ embeddings.clear();
+ fileIDs.clear();
+ results.clear();
+ // Allow some time for any GC to finish
await Future.delayed(const Duration(milliseconds: 100));
}
_logger.info(