[Dovecot] out of memory error
Hello
I have this errors in my dovecot.log every day or two:
... dovecot: Jan 24 10:28:56 Error: auth-worker(default): Out of memory (Needed 8164 bytes) dovecot: Jan 24 10:29:01 Error: auth-worker(default): Out of memory (Needed 8164 bytes) dovecot: Jan 24 10:29:03 Error: auth-worker(default): Out of memory (Needed 8164 bytes) dovecot: Jan 24 10:29:03 Error: auth-worker(default): Out of memory (Needed 8164 bytes) dovecot: Jan 24 10:29:03 Error: auth-worker(default): Out of memory (Needed 8164 bytes) dovecot: Jan 24 10:29:41 Error: auth-worker(default): Out of memory (Needed 8164 bytes) dovecot: Jan 24 10:29:56 Error: auth-worker(default): Out of memory (Needed 8164 bytes) dovecot: Jan 24 10:30:36 Error: auth-worker(default): Out of memory (Needed 8164 bytes) dovecot: Jan 24 10:30:38 Error: auth-worker(default): Out of memory (Needed 8164 bytes) dovecot: Jan 24 10:30:39 Error: auth-worker(default): Out of memory (Needed 52 bytes) dovecot: Jan 24 10:30:41 Error: auth-worker(default): pool_system_malloc(): Out of memory dovecot: Jan 24 10:30:41 Error: child 3576 (auth-worker) returned error 83 (Out of memory)
I use dovecot 1.0-beta1 login_process_size = 128 login_process_per_connection = no login_processes_count = 5 login_max_processes_count = 128 login_max_logging_users = 256
-- Pavel
On Tue, 2006-01-24 at 11:46 +0300, Pavel Volkovitskiy wrote:
Hello
I have this errors in my dovecot.log every day or two:
... dovecot: Jan 24 10:28:56 Error: auth-worker(default): Out of memory (Needed 8164 bytes)
Since that process is executing only MySQL queries, it looks like there's a memory leak somewhere in there.. Would be nice if someone with more time could take a look at it :)
For example you could try setting
auth_executable = /usr/bin/valgrind --leak-check=yes --num-callers=10 /usr/local/libexec/dovecot/dovecot-auth
And after some time send HUP signal to Dovecot, and then it should print to logs all the leaked memory.
Timo Sirainen wrote:
Since that process is executing only MySQL queries, it looks like there's a memory leak somewhere in there.. Would be nice if someone with
Probably this one: driver_mysql_query() calls sql_result_free(), which calls driver_mysql_result_free(), but that returns immediately (line 399 of driver-mysql.c), because result->callback was set to TRUE in driver_mysql_query(), so nothing is freed.
I already wondered about this when making the sqlite driver, but thought it must be there for a reason...
On 27.1.2006 00:28, "Jakob Hirsch" <jh@plonk.de> wrote:
Timo Sirainen wrote:
Since that process is executing only MySQL queries, it looks like there's a memory leak somewhere in there.. Would be nice if someone with
Probably this one: driver_mysql_query() calls sql_result_free(), which calls driver_mysql_result_free(), but that returns immediately (line 399 of driver-mysql.c), because result->callback was set to TRUE in driver_mysql_query(), so nothing is freed.
I already wondered about this when making the sqlite driver, but thought it must be there for a reason...
Right, thanks. Pgsql didn't leak though. Fixed in CVS now.
Timo Sirainen wrote:
On 27.1.2006 00:28, "Jakob Hirsch" <jh@plonk.de> wrote:
Timo Sirainen wrote:
Since that process is executing only MySQL queries, it looks like there's a memory leak somewhere in there.. Would be nice if someone with
Probably this one: driver_mysql_query() calls sql_result_free(), which calls driver_mysql_result_free(), but that returns immediately (line 399 of driver-mysql.c), because result->callback was set to TRUE in driver_mysql_query(), so nothing is freed.
I already wondered about this when making the sqlite driver, but thought it must be there for a reason...
Right, thanks. Pgsql didn't leak though. Fixed in CVS now.
Thanks, for fix!
-- Pavel
Timo Sirainen wrote:
Probably this one: driver_mysql_query() calls sql_result_free(), which calls driver_mysql_result_free(), but that returns immediately (line 399 of driver-mysql.c), because result->callback was set to TRUE in driver_mysql_query(), so nothing is freed. Right, thanks. Pgsql didn't leak though. Fixed in CVS now.
you're welcome. The sqlite driver didn't need a fix, though, since its result_free does not check for result->callback. To be honest, I don't even know what this flag is used for, I could not find any code that uses it.
btw, just saw that driver-sqlite.c includes time.h and stdlib.h, but that's not necessary.
On Fri, 2006-01-27 at 16:32 +0100, Jakob Hirsch wrote:
Timo Sirainen wrote:
Probably this one: driver_mysql_query() calls sql_result_free(), which calls driver_mysql_result_free(), but that returns immediately (line 399 of driver-mysql.c), because result->callback was set to TRUE in driver_mysql_query(), so nothing is freed. Right, thanks. Pgsql didn't leak though. Fixed in CVS now.
you're welcome. The sqlite driver didn't need a fix, though, since its result_free does not check for result->callback. To be honest, I don't even know what this flag is used for, I could not find any code that uses it.
Hmm. The point was that it would allow sql_query()'s callback function to call sql_result_free() without sql_query() function itself calling it again and crashing.
But I'm not sure why I added that. I thought there was a good reason for it at some point, but looks like I've lost the code which used it :) Maybe it could be useful in future though, so I'll change sqlite code to do the same.
btw, just saw that driver-sqlite.c includes time.h and stdlib.h, but that's not necessary.
Removed.
participants (3)
-
Jakob Hirsch
-
Pavel Volkovitskiy
-
Timo Sirainen