[asterisk-bugs] [JIRA] (ASTERISK-29184) memory leak manager.c:purge_old_stuff not scheduled when manager.conf enabled=no
Diederik de Groot (JIRA)
noreply at issues.asterisk.org
Fri Dec 18 01:03:16 CST 2020
[ https://issues.asterisk.org/jira/browse/ASTERISK-29184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=253144#comment-253144 ]
Diederik de Groot commented on ASTERISK-29184:
----------------------------------------------
I think i have found the cause but was not able to find a solution.
The "any_manager_listeners" macro is used to check if there are any listeners and "__ast_manager_event_multichan" skips adding events if no one is listening.
However chan-sccp uses a manager_hook and there is actively listening even if manager.conf is disabled. But with manager disabled and a manager_hook registered the purge method ought to be running to cleanup. Or there would have to be a way to check if manager is enabled from an external module like chan-sccp to prevent it from registering the manager_hook. The any_manager_listeners macro includes a check to see if there are manager_hooks registed. The purge is not active when manager_hooks are but manager is not enabled.
> memory leak manager.c:purge_old_stuff not scheduled when manager.conf enabled=no
> --------------------------------------------------------------------------------
>
> Key: ASTERISK-29184
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-29184
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Core/ManagerInterface
> Affects Versions: GIT, 17.8.1, 18.0.1, 16.15.0
> Environment: Any
> Reporter: Diederik de Groot
> Labels: ami, core, manager, memory-leak
> Attachments: eventq.log
>
>
> With enabled=off in manager.conf the `purge_old_stuff` function from main/manager.c is never scheduled and doesn't run. Meaning that any time the append_event is called (for example through __manager_event_sessions_va / manager_event) new memory is allocated for the event, it is inserted in the `eventqent`, but never released. Causing a non negligible memory consumption over time. Enabling manager/ami and reloading resolves the memory leak.
> Possible/Potential Solutions:
> - append_event could bail out early and not allocate memory.
> - purge_old_stuff could be scheduled even if ami/manager is not enabled.
> - purge_old_stuff could be scheduled on some other monitoring thread.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list