[syslog-ng] Memory not freeing up in syslog-ng-3.6.2 during reload

Peter Kokai (pkokai) Peter.Kokai at oneidentity.com
Tue Jan 7 11:35:26 UTC 2020


Hello,

Yes, we like to keep memory for ourselfs ;)[1]

This is in fact not syslog-ng reload, and mostly about patterndb component. You could verify leak with valgrind or sanitizer. Please if you find a leak check it on upstream and report if you have any.

Regarding the question that your application does leak or not is hard to tell withouth knowing it.
Please share your application and we might be able to help you.

Just a hint: things in syslog-ng usually like to be called like this:

new
init
deinit
free

In case of reference counted object also use unref instead of free, and ref well to reference stuff.

The init and deinit can be repeated multiple times (init, deinit, init, deinit, ...) also usually the repeation of single init is fine (init, init, ...).
(This is of course not a contract by any means.)

Have fun.

[1] Not really true.

--
Kokan

On Tue, Jan 07, 2020 at 02:35:43PM +0530, Nitish Saboo wrote:
> CAUTION: This email originated from outside of the organization. Do not follow guidance, click links, or open attachments unless you recognize the sender and know the content is safe.
> 
> Hi,
> 
> I am using syslog-ng version 3.6.2:
> 
> syslog-ng --version
> syslog-ng 3.6.2
> Installer-Version: 3.6.2
> Revision:
> Compile-Date: May  2 2019 01:20:32
> Available-Modules: afmongodb,afstomp,afuser,csvparser,afprog,afamqp,cryptofuncs,afsocket,graphite,dbparser,affile,syslogformat,afsocket-notls,system-source,confgen,pseudofile,linux-kmsg-format,basicfuncs
> Enable-Debug: off
> Enable-GProf: off
> Enable-Memtrace: off
> Enable-IPv6: on
> Enable-Spoof-Source: off
> Enable-TCP-Wrapper: off
> Enable-Linux-Caps: off
> 
> 
> I initialised syslog-ng with the following configuration:
> 
> int initialize_engine(const gchar* filename, const gchar* _module_path)
> {
>   module_path = _module_path;
>   app_startup();
>   msg_init(TRUE);
> 
>   configuration = cfg_new(0x0302);
>   plugin_load_module("basicfuncs", configuration, NULL);
>   plugin_load_module("syslogformat", configuration, NULL);
> 
>   pattern_db_global_init();
>   return 0;
>   }
> 
>   int reload_pattern_db(const gchar* filename, key_value_cb cb)
> {
>   if(patterndb!= NULL){
>     pattern_db_free(patterndb);
>   }
>   patterndb = pattern_db_new();
>   pattern_db_reload_ruleset(patterndb, configuration, filename);
>   pattern_db_set_emit_func(patterndb, pdbtool_pdb_emit_accumulate, cb);
>   return 0;
> }
> 
> When I reload the syslog-ng, the memory keeps on increasing.Looks like syslog-ng is not freeing up the memory.It continues to occupy the memory unless the process is restarted.
> Just want to understand if it is a sign of memory leak or default behavior of syslog-ng to not free-up memory during reload ?
> 
> Thanks,
> Nitish
> 

> ______________________________________________________________________________
> Member info: https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.balabit.hu%2Fmailman%2Flistinfo%2Fsyslog-ng&data=02%7C01%7Cpeter.kokai%40oneidentity.com%7C787bcb55bf024c043c6308d79350d004%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637139847625536021&sdata=siZ9%2BKokl%2FvxLmhWsuoL4PZcmzGFKk7PNW3vhfEQMRg%3D&reserved=0
> Documentation: https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fsupport%2Fdocumentation%2F%3Fproduct%3Dsyslog-ng&data=02%7C01%7Cpeter.kokai%40oneidentity.com%7C787bcb55bf024c043c6308d79350d004%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637139847625536021&sdata=%2FdBMM4ZmjzNQI2NYt8T3s3WXx1XTd7QtGmVjEvLDBA0%3D&reserved=0
> FAQ: https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fwiki%2Fsyslog-ng-faq&data=02%7C01%7Cpeter.kokai%40oneidentity.com%7C787bcb55bf024c043c6308d79350d004%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637139847625536021&sdata=JcZw66v9GCGWFly1RKTeCdgVaHzOaL1oXenDCQIpLqs%3D&reserved=0
> 


More information about the syslog-ng mailing list