Information: Forum is in read-only mode
For details and other support options see

rsyslogd memory leak

This is the place for developers to discuss bugs, new features and everything else about code changes.

Moderator: alorbach

Google Ads

rsyslogd memory leak

Postby nottoosmart » Wed Mar 18, 2015 3:14 am

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: Select all
#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");
        } else {
            int status;
            waitpid(-1, &status, 0);

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?
Posts: 17
Joined: Wed Apr 16, 2014 11:58 pm

Urgent Question?

  • Pulling out your Hair?
  • Wasting Time and Money?
  • Deadline Approaching?

Re: rsyslogd memory leak

Postby dlang » Wed Mar 18, 2015 5:06 am

you would have to look through the git history at what patches were applied.

You could ask on the mailing list and if someone happens to remember, they may speak up.

But in general, if a patch is fixed, that's good enough, when it was fixed doesn't matter much if it's before the oldest currently supported version.
Frequent Poster
Posts: 1002
Joined: Mon Sep 15, 2008 7:44 am

Google Ads

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 0 guests