[tracker/wip/carlosg/prune-batch] libtracker-sparql/direct: Prune content of already executed batches
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/prune-batch] libtracker-sparql/direct: Prune content of already executed batches
- Date: Tue, 27 Sep 2022 11:56:16 +0000 (UTC)
commit 944988326dda228c3257df4cefd0e98ca86a648c
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Sep 27 13:46:10 2022 +0200
libtracker-sparql/direct: Prune content of already executed batches
When using TrackerBatch from a garbage collected language, we have
little control over the actual lifetime of a batch object, while
at the same time we keep the GC unaware about how much memory does
really depend on that object. This may cause RAM usage spikes when
the GC hoards too many already executed batches during intensive
data insertion.
A TrackerBatch is a single-use object though, in order to ease this
memory usage, we can dispose early of all inserted resources and
SPARQL updates right after execution, so the TrackerBatch is left a
husk when all that is left to do with it is freeing it.
src/libtracker-sparql/direct/tracker-direct-batch.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/src/libtracker-sparql/direct/tracker-direct-batch.c
b/src/libtracker-sparql/direct/tracker-direct-batch.c
index bf3d04b66..cab313836 100644
--- a/src/libtracker-sparql/direct/tracker-direct-batch.c
+++ b/src/libtracker-sparql/direct/tracker-direct-batch.c
@@ -242,6 +242,8 @@ tracker_direct_batch_update (TrackerDirectBatch *batch,
break;
}
+ g_array_set_size (priv->array, 0);
+
if (!inner_error)
tracker_data_update_buffer_flush (data, &inner_error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]