[asterisk-bugs] [Asterisk 0013409]: [patch] Huge memory leak because memory of channel cdr struct is never returned

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Sep 2 17:06:46 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13409 
====================================================================== 
Reported By:                tomaso
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   13409
Category:                   Core/Channels
Reproducibility:            always
Severity:                   block
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.0 
SVN Revision (number only!): 137818 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-09-01 09:48 CDT
Last Modified:              2008-09-02 17:06 CDT
====================================================================== 
Summary:                    [patch] Huge memory leak because memory of channel
cdr struct is never returned
Description: 
After two days of stress testing by making lots of calls across sip and
dahdi channels the asterisk process memory reached dizzy values: VSZ=3,2GB,
RSS=1,6GB before asterisk stucked completely (even the RAM of our server
(2GB) is finite ;-) ).

Actually this problem is not a question of load, but appears for each
single call.

Using valgrind the reason for that was quickly found: The memory of the
channel cdr struct (chan->cdr) is never returned, not for sip, not for
dahdi channels, when a channel is cleared.

Reproduce:
a.f.a.p. default configuration (modules.conf, etc.)
Make lots of calls and see ps's VSZ and RSS values.

Interested in a patch ? Or is someone revise this anyway?

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

---------------------------------------------------------------------- 
 (0091993) svnbot (reporter) - 2008-09-02 17:06
 http://bugs.digium.com/view.php?id=13409#c91993 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 140670

U   branches/1.4/main/channel.c
U   branches/1.4/main/pbx.c

------------------------------------------------------------------------
r140670 | murf | 2008-09-02 17:06:45 -0500 (Tue, 02 Sep 2008) | 14 lines

(closes issue http://bugs.digium.com/view.php?id=13409)
Reported by: tomaso
Patches:
      asterisk-1.6.0-rc2-cdrmemleak.patch uploaded by tomaso (license 564)

I basically spent the day, verifying that this patch 
solves the problem, and doesn't hurt in non-problem 
cases. Why valgrind did not plainly reveal this leak
absolutely mystifies and stuns me. 

Many, many thanks to tomaso for finding and providing the fix.



------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=140670 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-09-02 17:06 svnbot         Checkin                                      
2008-09-02 17:06 svnbot         Note Added: 0091993                          
======================================================================




More information about the asterisk-bugs mailing list