[asterisk-bugs] [Asterisk 0017234]: Memory leak in manager.c

Asterisk Bug Tracker noreply at bugs.digium.com
Mon May 10 16:44:25 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17234 
====================================================================== 
Reported By:                mav3rick
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17234
Category:                   Core/ManagerInterface
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     acknowledged
Target Version:             1.6.2.9
Asterisk Version:           1.6.2.7-rc2 
JIRA:                       SWP-1333 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-04-23 06:02 CDT
Last Modified:              2010-05-10 16:44 CDT
====================================================================== 
Summary:                    Memory leak in manager.c
Description: 
I detected a memory leak in manager.c, on latest Asterisk 1.6.2.7-rc2.
Leak is reproductible in 1.6.2.6.

   6622144 bytes in 30993 allocations in file 'manager.c'
   7100873 bytes in 33065 allocations in file 'manager.c'
   7352505 bytes in 34160 allocations in file 'manager.c'
   7636791 bytes in 35405 allocations in file 'manager.c'
   8039968 bytes in 37165 allocations in file 'manager.c'
   9430346 bytes in 43322 allocations in file 'manager.c'

I'm sending Originate (async) AMI commands using the built-in HTTP
server.

Attached: valgrind run with --leak-check=full --show-reachable=yes, and
"memory show allocations". Asterisk was compiled with MALLOC_DEBUG and
DONT_OPTIMIZE.


====================================================================== 

---------------------------------------------------------------------- 
 (0121680) tilghman (administrator) - 2010-05-10 16:44
 https://issues.asterisk.org/view.php?id=17234#c121680 
---------------------------------------------------------------------- 
I've now learned that this is not actually a bug but rather a failure on
the HTTP client part to query for events.  The HTTP client may not only
send actions, but must periodically query for any events which may have
accumulated on the server side with the Action: WaitEvent action (optional
Timeout header, specified in seconds).  The response to this action will be
a list of Events.

These accumulated events are what are consuming memory.  Once all
connected clients have received the cached events, the events are freed
within 5 seconds. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-05-10 16:44 tilghman       Note Added: 0121680                          
======================================================================




More information about the asterisk-bugs mailing list