sni / mod_gearman

Distribute Naemon Host/Service Checks & Eventhandler with Gearman Queues. Host/Servicegroups affinity included.
http://www.mod-gearman.org
GNU General Public License v3.0
122 stars 42 forks source link

Memory leak #106

Closed jframeau closed 7 years ago

jframeau commented 7 years ago

Hi sven, I think there's a heavy memory leak around processing macros.

process_macros_r function mallocs et reallocs many times (stored in mac structure) but these allocations are never deallocated in both handle_host_check nor handle_service_check when cleaning memory at end.

Before this update, naemon was losing about 1 Mo/minute (1000 hosts, 10000 services). With my update, running now for 24 hours, naemon stays a 20 Mo without any leak.

What do you think about ?

jfr

sni commented 7 years ago

Great, thanks for investigating this issue. I guess we have to #ifdef that to naemon only.

jframeau commented 7 years ago

Should be better now.

sni commented 7 years ago

Thank you very much.