dovecot-2.0-sslstream: dsync: Memory usage tweaks.

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:55:49 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/a553595ce5a9
changeset: 10218:a553595ce5a9
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Oct 28 16:12:06 2009 -0400
description:
dsync: Memory usage tweaks.

diffstat:

2 files changed, 12 insertions(+), 7 deletions(-)
src/dsync/dsync-brain.c        |    7 +++++--
src/dsync/dsync-proxy-client.c |   12 +++++++-----

diffs (48 lines):

diff -r e3d0385ce703 -r a553595ce5a9 src/dsync/dsync-brain.c
--- a/src/dsync/dsync-brain.c	Wed Oct 28 16:01:06 2009 -0400
+++ b/src/dsync/dsync-brain.c	Wed Oct 28 16:12:06 2009 -0400
@@ -333,12 +333,15 @@ static void dsync_brain_sync_msgs(struct
 static void dsync_brain_sync_msgs(struct dsync_brain *brain)
 {
 	ARRAY_TYPE(dsync_brain_mailbox) mailboxes;
-
-	t_array_init(&mailboxes, 128);
+	pool_t pool;
+
+	pool = pool_alloconly_create("dsync changed mailboxes", 10240);
+	p_array_init(&mailboxes, pool, 128);
 	dsync_brain_get_changed_mailboxes(brain, &mailboxes,
 		(brain->flags & DSYNC_BRAIN_FLAG_FULL_SYNC) != 0);
 	brain->mailbox_sync = dsync_brain_msg_sync_init(brain, &mailboxes);
 	dsync_brain_msg_sync_more(brain->mailbox_sync);
+	pool_unref(&pool);
 }
 
 static void
diff -r e3d0385ce703 -r a553595ce5a9 src/dsync/dsync-proxy-client.c
--- a/src/dsync/dsync-proxy-client.c	Wed Oct 28 16:01:06 2009 -0400
+++ b/src/dsync/dsync-proxy-client.c	Wed Oct 28 16:12:06 2009 -0400
@@ -379,16 +379,18 @@ proxy_client_worker_msg_iter_init(struct
 
 	iter = i_new(struct proxy_client_dsync_worker_msg_iter, 1);
 	iter->iter.worker = _worker;
-	iter->pool = pool_alloconly_create("proxy message iter", 1024);
-
-	str = t_str_new(512);
+	iter->pool = pool_alloconly_create("proxy message iter", 10240);
+
+	str = str_new(iter->pool, 512);
 	str_append(str, "MSG-LIST");
-	for (i = 0; i < mailbox_count; i++) {
+	for (i = 0; i < mailbox_count; i++) T_BEGIN {
 		str_append_c(str, '\t');
 		dsync_proxy_mailbox_guid_export(str, &mailboxes[i]);
-	}
+	} T_END;
 	str_append_c(str, '\n');
 	o_stream_send(worker->output, str_data(str), str_len(str));
+	p_clear(iter->pool);
+
 	proxy_client_worker_output_flush(_worker);
 	return &iter->iter;
 }


More information about the dovecot-cvs mailing list