[tracker/rss-enclosures] libtracker-data: Make sure update buffer does not grow without limits
- From: Roberto Guido <rguido src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/rss-enclosures] libtracker-data: Make sure update buffer does not grow without limits
- Date: Sat, 26 Jun 2010 23:17:26 +0000 (UTC)
commit 73e3cad8dc80c7ed17ca243abcc0a2dde217ea64
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]