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



commit 4392677fcd16c9d968e604d2fa291a53c5edfb34
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 0ae6391..97619ec 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -1625,6 +1625,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]