[rsyslog-notify] Forum Thread: rsyslogd memory leak - (Mode 'post')

noreply at adiscon.com noreply at adiscon.com
Wed Mar 18 03:14:08 CET 2015


User: nottoosmart 
Forumlink: http://kb.monitorware.com/viewtopic.php?p=25331#p25331

Message: 
----------
There was some kind of memory leaked that was patched in one of the
versions, but I don't know what version it was.  I was checking through the
git log but can't figure out which patch fixed it.

I tested this in rsyslogd version 7.6.3 and prior (5.6 something).  There
is a bug where it seems to track PID's and continuously grow memory usage.
I was able to test this with this little C program:

[code:33izqnf2]
#include <sys/types.h>
#include <sys/wait.h>
#include <cstdlib>
#include <syslog.h>
#include <unistd.h>

int main() {
    while (1) {
        if (!fork()) {
            openlog("blah", LOG_PID, LOG_USER);
            syslog(LOG_INFO, "blah");
            exit(0);
        } else {
            int status;
            waitpid(-1, &status, 0);
        }
    }
}
[/code:33izqnf2]

Basically, if you watch 'ps auwwx | grep rsyslogd' while this is running,
it shows that over time the memory usage continues to increase and never
become released.  This has caused a lot of OOM'ing on my servers as
rsyslogd seems to track PID's and never release.  Somewhere in time this
was fixed, I just don't know exactly which version has the patch and what
exactly the patch is that fixed it.  I tested this with rsyslogd 8.7.0 and
it is fixed in that version..... so somewhere between 7.6.3 and 8.7.0 this
was fixed.

I would like more information on this patch and the version where the fix
begins.

Can anyone help me figure this out?


More information about the rsyslog-notify mailing list