[asterisk-dev] [Code Review]: MALLOC_DEBUG atexit unreleased malloc memory summary.

rmudgett reviewboard at asterisk.org
Mon Nov 12 18:09:39 CST 2012



> On Nov. 12, 2012, 4:39 p.m., David Lee wrote:
> > /branches/1.8/main/astmm.c, line 1235
> > <https://reviewboard.asterisk.org/r/2196/diff/1/?file=32151#file32151line1235>
> >
> >     So what happens if some thread takes longer than 10 seconds to die? Is the allocator still in usable condition after mm_atexit_dump()?

The allocator is still usable.  That is the purpose of mm_atexit_hash_restore() and the comment where it is called.  I found out that mm_atexit_final() can be called before all other threads have terminated.  If mm_atexit_hash_restore() does not exist then any thread freeing previously allocated memory would get an unregistered memory warning.


> On Nov. 12, 2012, 4:39 p.m., David Lee wrote:
> > /branches/1.8/main/astmm.c, line 46
> > <https://reviewboard.asterisk.org/r/2196/diff/1/?file=32151#file32151line46>
> >
> >     Since you're going through the trouble of adding a comment, you should state the tradeoffs for making it large. Why not just use 2147483647?

Added tradeoff comment.


- rmudgett


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2196/#review7385
-----------------------------------------------------------


On Nov. 12, 2012, 3:28 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2196/
> -----------------------------------------------------------
> 
> (Updated Nov. 12, 2012, 3:28 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> * Adds the following CLI commands to control MALLOC_DEBUG reporting of unreleased malloc memory when Asterisk is shut down.
> memory atexit list on
> memory atexit list off
> memory atexit summary byline
> memory atexit summary byfunc
> memory atexit summary byfile
> memory atexit summary off
> 
> * Made check all remaining allocated region blocks atexit for fence violations.
> 
> * Increased the allocated region hash table size by about three times.  It still isn't large enough considering the number of malloced blocks Asterisk uses.
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/main/astmm.c 376169 
> 
> Diff: https://reviewboard.asterisk.org/r/2196/diff
> 
> 
> Testing
> -------
> 
> Started Asterisk.
> CLI "memory atexit list on"
> CLI "memory atexit summary byline"
> CLI "memory atexit summary byfunc"
> CLI "memory atexit summary byfile"
> 
> Output format at Asterisk exit as intended for unreleased memory.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121113/e0f5791c/attachment.htm>


More information about the asterisk-dev mailing list