[asterisk-bugs] [JIRA] (ASTERISK-28609) Memory Leak in frame.c

Ted G (JIRA) noreply at issues.asterisk.org
Sat Nov 23 13:45:32 CST 2019


     [ https://issues.asterisk.org/jira/browse/ASTERISK-28609?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted G updated ASTERISK-28609:
-----------------------------

    Comment: was deleted

(was: Memory hasnt gone crazy on the box yet.  Sometimes it can take awhile.  Here is what it currently looks like:

{code}
      3584 bytes in          4 allocations in file ../src/pj/pool_policy_malloc.c
    270832 bytes in        422 allocations in file /usr/src/asterisk-16.3.0/include/asterisk/strings.h
    144268 bytes in        513 allocations in file /usr/src/asterisk-16.3.0/include/asterisk/threadstorage.h
     71340 bytes in        377 allocations in file abstract_jb.c
     72920 bytes in         87 allocations in file app_confbridge.c
    445370 bytes in        392 allocations in file app_mixmonitor.c
       752 bytes in          4 allocations in file ari/config.c
      8450 bytes in        267 allocations in file asterisk.c
        48 bytes in          2 allocations in file astobj2.c
    344592 bytes in       4786 allocations in file astobj2_hash.c
      1120 bytes in         14 allocations in file astobj2_rbtree.c
     10320 bytes in         86 allocations in file audiohook.c
      4032 bytes in         56 allocations in file autochan.c
       672 bytes in         14 allocations in file autoservice.c
    234504 bytes in       1094 allocations in file bridge.c
     28000 bytes in         70 allocations in file bridge_channel.c
      2688 bytes in         70 allocations in file bridge_roles.c
   2519144 bytes in        126 allocations in file bridge_softmix.c
      1080 bytes in          2 allocations in file bucket.c
       880 bytes in          8 allocations in file ccss.c
     25000 bytes in          4 allocations in file cdr.c
      6816 bytes in          6 allocations in file cel.c
    170535 bytes in         73 allocations in file chan_dahdi.c
   1037438 bytes in       1406 allocations in file chan_sip.c
    219249 bytes in        721 allocations in file channel.c
    139080 bytes in        342 allocations in file channel_internal_api.c
      9714 bytes in        470 allocations in file cli.c
      6144 bytes in         47 allocations in file codec.c
   6540924 bytes in       2436 allocations in file confbridge/conf_config_parser.c
     85440 bytes in        605 allocations in file config.c
     39368 bytes in        215 allocations in file config_options.c
       216 bytes in          2 allocations in file core_local.c
     89152 bytes in         56 allocations in file core_unreal.c
       840 bytes in         56 allocations in file datastore.c
    192778 bytes in       2841 allocations in file devicestate.c
    224640 bytes in        156 allocations in file dsp.c
      2448 bytes in          2 allocations in file endpoints.c
    154207 bytes in       1045 allocations in file features_config.c
   2033425 bytes in        212 allocations in file file.c
      7520 bytes in        103 allocations in file format.c
       992 bytes in          1 allocations in file format_cache.c
    179248 bytes in       1876 allocations in file format_cap.c
      7952 bytes in        142 allocations in file framehook.c
    475408 bytes in        172 allocations in file func_volume.c
       730 bytes in          4 allocations in file http.c
     42263 bytes in       1200 allocations in file indications.c
      8228 bytes in          4 allocations in file io.c
    334432 bytes in        317 allocations in file jitterbuf.c
     35767 bytes in        607 allocations in file json.c
     14013 bytes in        214 allocations in file loader.c
      8381 bytes in          5 allocations in file logger.c
    149067 bytes in        232 allocations in file manager.c
      1096 bytes in          1 allocations in file media_cache.c
        96 bytes in          2 allocations in file message.c
       784 bytes in          2 allocations in file named_acl.c
      1736 bytes in          1 allocations in file named_locks.c
      8799 bytes in        229 allocations in file optional_api.c
     43034 bytes in        235 allocations in file pbx.c
    275344 bytes in        192 allocations in file pbx_app.c
       568 bytes in         22 allocations in file pbx_config.c
    171248 bytes in         59 allocations in file pbx_functions.c
     46015 bytes in        804 allocations in file pbx_variables.c
       144 bytes in          1 allocations in file res_ari.c
       296 bytes in          2 allocations in file res_fax.c
    106350 bytes in        831 allocations in file res_musiconhold.c
      2087 bytes in         35 allocations in file res_pjproject.c
  27446120 bytes in     132721 allocations in file res_rtp_asterisk.c
       136 bytes in          1 allocations in file res_smdi.c
       409 bytes in          3 allocations in file res_sorcery_config.c
      7880 bytes in          5 allocations in file res_stasis.c
     22288 bytes in        199 allocations in file res_timing_timerfd.c
    262720 bytes in        605 allocations in file rtp_engine.c
    293704 bytes in        644 allocations in file sched.c
     50304 bytes in         24 allocations in file sig_analog.c
       712 bytes in          1 allocations in file sig_pri.c
      6248 bytes in         80 allocations in file sip/route.c
     28080 bytes in         53 allocations in file slinfactory.c
   1301120 bytes in         80 allocations in file smoother.c
     12370 bytes in         56 allocations in file sorcery.c
    518227 bytes in       6803 allocations in file stasis.c
      2208 bytes in          2 allocations in file stasis/messaging.c
      8848 bytes in         28 allocations in file stasis_bridges.c
    247581 bytes in       3472 allocations in file stasis_cache.c
     12576 bytes in        131 allocations in file stasis_cache_pattern.c
    498864 bytes in        228 allocations in file stasis_channels.c
    220950 bytes in       3147 allocations in file stasis_message.c
      1296 bytes in          7 allocations in file stasis_message_router.c
     18552 bytes in          1 allocations in file stdtime/localtime.c
     23132 bytes in        596 allocations in file stream.c
    125064 bytes in       1844 allocations in file stringfields.c
      7781 bytes in        151 allocations in file strings.c
     35262 bytes in         90 allocations in file taskprocessor.c
      9704 bytes in         11 allocations in file threadpool.c
      3344 bytes in        202 allocations in file timing.c
   5866528 bytes in        514 allocations in file translate.c
       160 bytes in          2 allocations in file udptl.c
     15542 bytes in        209 allocations in file utils.c
   1073986 bytes in       5455 allocations in file xmldoc.c
  55185304 bytes allocated in 183747 selected allocations

  55185304 bytes in all allocations
    675152 bytes in deferred free large allocations
     25681 bytes in deferred free small allocations
    700833 bytes in deferred free allocations
  55886137 bytes in all allocations and deferred free allocations
{code}
)

> Memory Leak in frame.c
> ----------------------
>
>                 Key: ASTERISK-28609
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28609
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: General
>    Affects Versions: 16.3.0
>            Reporter: Ted G
>            Assignee: Unassigned
>            Severity: Minor
>              Labels: fax, patch
>         Attachments: frame-malloc-debug.patch
>
>
> Hello,
>   There appears to be a memory leak in frame.c.
> Sometimes I received these errors in my logs:
> [Nov  5 21:14:49] WARNING[14918][C-00028a27]: file.c:258 ast_writestream: Translated frame write failed
> I believe this happenes because of some issues between my carrier and the asterisk system and most of the time these errors are not frequent.
> However sometimes these errors are produced thousands of times per day and when that happens the memory usage for asterisk shoots up and never recovers:
> ...
>    1073986 bytes in       5455 allocations in file xmldoc.c
>    1327380 bytes in       1819 allocations in file chan_sip.c
>    1351770 bytes in        840 allocations in file res_rtp_asterisk.c
>    1707720 bytes in        105 allocations in file smoother.c
>    2409853 bytes in        255 allocations in file file.c
>    2988480 bytes in        163 allocations in file bridge_softmix.c
>    7310456 bytes in        633 allocations in file translate.c
>    7434868 bytes in       2773 allocations in file confbridge/conf_config_parser.c
>  899355372 bytes ( 899355372 cache) in    2046261 allocations in file frame.c         <----
>  933339512 bytes allocated (899355372 in caches) in 2102261 selected allocations
>  933339512 bytes in all allocations
>  934016850 bytes in all allocations and deferred free allocations
> axis/root# top -b -n 1 | grep asterisk
> 19727 root      20   0 3353860 1.314g   8256 S 111.8  2.1  16620:19 asterisk     1.3GB :(
> System uptime: 1 week, 3 days, 23 hours, 34 minutes, 42 seconds
> 1 week, 3 days worth of frame write failed error counts:
> mmdd errors
> 1027 2218
> 1028 1426
> 1029 5275
> 1030 2454
> 1031 1612
> 1101 2797
> 1102 1635
> 1103 3278
> 1104 743
> 1105 1117



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list