[tracker/tracker-0.8] libtracker-data: Make sure update buffer does not grow without limits



commit fd29cb36cf77d73ff6c175f4bc20805fe1d27d9c
Author: Jürg Billeter <j bitron ch>
Date:   Thu Jun 10 15:06:52 2010 +0200

    libtracker-data: Make sure update buffer does not grow without limits
    
    Large INSERTs with thousands of resources could lead to high peak
    memory usage without this.
    
    Fixes NB#173589.

 src/libtracker-data/tracker-data-update.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 912309e..fc75799 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -1556,6 +1556,11 @@ resource_buffer_switch (const gchar *graph,
 		GValue gvalue = { 0 };
 		gchar *subject_dup = NULL;
 
+		/* large INSERTs with thousands of resources could lead to
+		   high peak memory usage due to the update buffer
+		   flush the buffer if it already contains 1000 resources */
+		tracker_data_update_buffer_might_flush (NULL);
+
 		/* subject not yet in cache, retrieve or create ID */
 		resource_buffer = g_slice_new0 (TrackerDataUpdateBufferResource);
 		if (subject != NULL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]