Skip to content

Commit

Permalink
lib-smtp: Increase memory pool initial sizes
Browse files Browse the repository at this point in the history
This reduces malloc traffic
  • Loading branch information
cmouse authored and villesavolainen committed Sep 25, 2018
1 parent 255d1ae commit 1e7869f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/lib-http/test-http-client-errors.c
Expand Up @@ -2988,7 +2988,7 @@ server_connection_init(int fd)

net_set_nonblock(fd, TRUE);

pool = pool_alloconly_create("server connection", 256);
pool = pool_alloconly_create("server connection", 512);
conn = p_new(pool, struct server_connection, 1);
conn->pool = pool;

Expand Down
2 changes: 1 addition & 1 deletion src/lib-smtp/smtp-client-connection.c
Expand Up @@ -1622,7 +1622,7 @@ smtp_client_connection_create(struct smtp_client *client,
struct smtp_client_connection *conn;
pool_t pool;

pool = pool_alloconly_create("smtp client connection", 512);
pool = pool_alloconly_create("smtp client connection", 2048);
conn = p_new(pool, struct smtp_client_connection, 1);
conn->refcount = 1;
conn->pool = pool;
Expand Down
4 changes: 2 additions & 2 deletions src/lib-smtp/smtp-client-transaction.c
Expand Up @@ -45,7 +45,7 @@ smtp_client_transaction_rcpt_new(
struct smtp_client_transaction_rcpt *rcpt;
pool_t pool;

pool = pool_alloconly_create("smtp transaction rcpt", 256);
pool = pool_alloconly_create("smtp transaction rcpt", 512);
rcpt = p_new(pool, struct smtp_client_transaction_rcpt, 1);
rcpt->pool = pool;
rcpt->trans = trans;
Expand Down Expand Up @@ -163,7 +163,7 @@ smtp_client_transaction_create(struct smtp_client_connection *conn,
struct smtp_client_transaction *trans;
pool_t pool;

pool = pool_alloconly_create("smtp transaction", 512);
pool = pool_alloconly_create("smtp transaction", 4096);
trans = p_new(pool, struct smtp_client_transaction, 1);
trans->refcount = 1;
trans->pool = pool;
Expand Down
2 changes: 1 addition & 1 deletion src/lib-smtp/smtp-reply-parser.c
Expand Up @@ -146,7 +146,7 @@ smtp_reply_parser_restart(struct smtp_reply_parser *parser)
pool_unref(&parser->reply_pool);
i_zero(&parser->state);

parser->reply_pool = pool_alloconly_create("smtp_reply", 256);
parser->reply_pool = pool_alloconly_create("smtp_reply", 1024);
parser->state.reply = p_new(parser->reply_pool, struct smtp_reply, 1);
p_array_init(&parser->state.reply_lines, parser->reply_pool, 8);

Expand Down
2 changes: 1 addition & 1 deletion src/lib-smtp/smtp-server-command.c
Expand Up @@ -154,7 +154,7 @@ smtp_server_command_alloc(struct smtp_server_connection *conn)
struct smtp_server_command *cmd;
pool_t pool;

pool = pool_alloconly_create("smtp_server_command", 256);
pool = pool_alloconly_create("smtp_server_command", 1024);
cmd = p_new(pool, struct smtp_server_command, 1);
cmd->context.pool = pool;
cmd->context.cmd = cmd;
Expand Down
2 changes: 1 addition & 1 deletion src/lib-smtp/smtp-server-connection.c
Expand Up @@ -770,7 +770,7 @@ smtp_server_connection_alloc(struct smtp_server *server,
struct smtp_server_connection *conn;
pool_t pool;

pool = pool_alloconly_create("smtp server", 512);
pool = pool_alloconly_create("smtp server", 1024);
conn = p_new(pool, struct smtp_server_connection, 1);
conn->pool = pool;
conn->refcount = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/lib-smtp/smtp-server-transaction.c
Expand Up @@ -23,7 +23,7 @@ smtp_server_transaction_create(struct smtp_server_connection *conn,
string_t *id;

/* create new transaction */
pool = pool_alloconly_create("smtp server transaction", 512);
pool = pool_alloconly_create("smtp server transaction", 4096);
trans = p_new(pool, struct smtp_server_transaction, 1);
trans->pool = pool;
trans->conn = conn;
Expand Down

0 comments on commit 1e7869f

Please sign in to comment.