[Asterisk-Dev] Suspected memory leak in 1.0.9

Thralling Penguin LLC joe at thrallingpenguin.com
Thu Sep 22 12:00:43 MST 2005


A suggestion that would help is a Cron script that captures the output of 'show memory summary' every 10 minutes.

I actually have a Python script that does this, parses it to a "database" format and uses a PHP graphing class to chart each part... This gives a GREAT visual clue as to what's leaking...

-Joe
Thralling Penguin LLC

 
On Wed, Sep 21, 2005 at 02:20:16PM +0800, Craig Guy wrote:
> Hi,
> 
> I am experiencing some symptoms on my asterisk servers leading me to think 
> there could be a memory leak in 1.0.9.  Over a period of 2-3 days Asterisk 
> ends up being allocated in excess of 1Gb memory.  A restart of the asterisk 
> service releases all of this memory every time.
> 
> Are there any things I can do to try and track down the source of the leak? 
> These are production systems taking inbound calls only on digium PRI cards. 
> The amount of memory in use over time seems to be related to call volume. 
> If there is a better or standard way to report this please let me know.
> 
> I am running with astmm options compiled and did manage to track down a 
> memory leak in app_ldap which has now been fixed but my memory symptoms 
> continue.  Typical output from the top command looks like below:
> 
> 21184 asterisk  16   0  913m 254m 2864 S  0.0 50.7   0:00.39 asterisk
> 21196 asterisk  16   0  913m 254m 2864 S  0.0 50.7   0:00.20 asterisk
> 21198 asterisk  17   0  913m 254m 2864 S  0.0 50.7   0:00.00 asterisk
> 21199 asterisk  20   0  913m 254m 2864 S  0.0 50.7   0:00.00 asterisk
> 21200 asterisk  15   0  913m 254m 2864 S  0.0 50.7   0:19.63 asterisk
> 21203 asterisk  20   0  913m 254m 2864 S  0.0 50.7   0:00.00 asterisk
> 21204 asterisk  16   0  913m 254m 2864 S  0.0 50.7   0:00.00 asterisk
> 21205 asterisk  20   0  913m 254m 2864 S  0.0 50.7   0:00.00 asterisk
> 21206 asterisk  15   0  913m 254m 2864 S  0.0 50.7   1:22.75 asterisk
> 21208 asterisk  16   0  913m 254m 2864 S  0.0 50.7   0:00.00 asterisk
> 21209 asterisk  16   0  913m 254m 2864 S  0.0 50.7   0:00.00 asterisk
> 21210 asterisk  16   0  913m 254m 2864 S  0.0 50.7   0:00.00 asterisk
> 21211 asterisk  20   0  913m 254m 2864 S  0.0 50.7   0:00.00 asterisk
> 21212 asterisk  16   0  913m 254m 2864 S  0.0 50.7   0:00.00 asterisk
> 21213 asterisk  16   0  913m 254m 2864 S  0.0 50.7   0:01.67 asterisk
> 21214 asterisk  16   0  913m 254m 2864 S  0.0 50.7   0:00.75 asterisk
> 21215 asterisk  16   0  913m 254m 2864 S  0.0 50.7   0:00.30 asterisk
> 32076 asterisk  15   0  913m 254m 2864 S  0.0 50.7   0:01.72 asterisk
> 
> Typical output from asterisk cli 'show memory summary' looks like:
> 
>        84 bytes in     1 allocations in file 'enum.c'
>        28 bytes in     1 allocations in file 'translate.c'
>       652 bytes in     1 allocations in file 'src/gsm_create.c'
>         8 bytes in     1 allocations in file 'res_agi.c'
>      1088 bytes in     1 allocations in file 'app_queue.c'
>     32120 bytes in     1 allocations in file 'codec_gsm.c'
>        20 bytes in     1 allocations in file 'cli.c'
>       752 bytes in     2 allocations in file 'res_crypto.c'
>      4656 bytes in     4 allocations in file 'chan_sip.c'
>       244 bytes in     1 allocations in file 'iax2-provision.c'
>         8 bytes in     1 allocations in file 'asterisk.c'
>       264 bytes in     1 allocations in file 'format_gsm.c'
>         1 bytes in     1 allocations in file 'res_features.c'
>      1320 bytes in     4 allocations in file 'cdr.c'
>       360 bytes in    10 allocations in file 'sched.c'
>       636 bytes in     1 allocations in file 'res_musiconhold.c'
>     20592 bytes in    16 allocations in file 'io.c'
>       720 bytes in     1 allocations in file 'dsp.c'
>     85291 bytes in    25 allocations in file 'chan_zap.c'
>       241 bytes in    11 allocations in file 'config.c'
>      4220 bytes in     5 allocations in file 'app_voicemail.c'
>      8012 bytes in    12 allocations in file 'channel.c'
>      2416 bytes in     8 allocations in file 'chan_iax2.c'
>       744 bytes in    31 allocations in file 'manager.c'
>      2856 bytes in    14 allocations in file 'file.c'
>     32256 bytes in   112 allocations in file 'loader.c'
>     17937 bytes in   404 allocations in file 'logger.c'
>     97552 bytes in   871 allocations in file 'frame.c'
>       355 bytes in    42 allocations in file 'chanvars.c'
>     11527 bytes in   691 allocations in file 'res_indications.c'
>      2169 bytes in    99 allocations in file 'pbx_config.c'
>     34408 bytes in   240 allocations in file 'pbx.c'
> 363537 bytes allocated 2614 units total
> 
> Craig 
> 
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev



More information about the asterisk-dev mailing list