<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>I think PJSIP never releases memory<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>This Is without any open calls.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Every command is very slow.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> rasterisk -x "memory show allocations" |sort -t" " -n -k1 | tail -20<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 25192 bytes allocated by sip_options_contact_statuses_alloc() line 415 of res_pjsip/pjsip_options.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 25216 bytes allocated by ast_res_pjsip_init_options_handling() line 2946 of res_pjsip/pjsip_options.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 26496 bytes allocated by load_module() line 155 of codec_resample.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 32720 bytes allocated by acf_retrieve_docs() line 359 of pbx_functions.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 65488 bytes allocated by acf_retrieve_docs() line 359 of pbx_functions.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 65488 bytes allocated by ast_register_application2() line 157 of pbx_app.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 68000 bytes allocated by default_block_alloc() line 46 of ../src/pj/pool_policy_malloc.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 68000 bytes allocated by default_block_alloc() line 46 of ../src/pj/pool_policy_malloc.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 524408 bytes allocated by load_objects() line 14840 of chan_iax2.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 524408 bytes allocated by load_objects() line 14846 of chan_iax2.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 524800 bytes allocated by default_block_alloc() line 46 of ../src/pj/pool_policy_malloc.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 524800 bytes allocated by default_block_alloc() line 46 of ../src/pj/pool_policy_malloc.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 703967 bytes in deferred free large allocations<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 718236 bytes in deferred free allocations<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 1052000 bytes allocated by default_block_alloc() line 46 of ../src/pj/pool_policy_malloc.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 2100000 bytes allocated by default_block_alloc() line 46 of ../src/pj/pool_policy_malloc.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 20972000 bytes allocated by default_block_alloc() line 46 of ../src/pj/pool_policy_malloc.c<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 41054128 bytes allocated (9224 in caches) in 82929 selected allocations<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 41054128 bytes in all allocations<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 41772364 bytes in all allocations and deferred free allocations<o:p></o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> asterisk-users <asterisk-users-bounces@lists.digium.com> <b>On Behalf Of </b>Federico<br><b>Sent:</b> Thursday, July 13, 2023 8:10 PM<br><b>To:</b> 'Asterisk Users Mailing List - Non-Commercial Discussion' <asterisk-users@lists.digium.com><br><b>Subject:</b> [asterisk-users] memory leak?<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This is asterisk 16.30.1, after 1 hours, with 17 contacts, yet we need to kill it every two hours because it stops processing calls.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>rasterisk -x "core show channels count" <o:p></o:p></p><p class=MsoNormal>43 active channels<o:p></o:p></p><p class=MsoNormal>29 active calls<o:p></o:p></p><p class=MsoNormal>7260 calls processed<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>time rasterisk -x "memory show summary" | sort -n | tail -20<o:p></o:p></p><p class=MsoNormal> 720985 bytes in deferred free allocations<o:p></o:p></p><p class=MsoNormal> 775206 bytes in 20242 allocations in file res_rtp_asterisk.c<o:p></o:p></p><p class=MsoNormal> 1142456 bytes in 18 allocations in file chan_iax2.c<o:p></o:p></p><p class=MsoNormal> 1190880 bytes in 4392 allocations in file stasis_bridges.c<o:p></o:p></p><p class=MsoNormal> 1217799 bytes in 6141 allocations in file xmldoc.c<o:p></o:p></p><p class=MsoNormal> 1508416 bytes in 8782 allocations in file cdr.c<o:p></o:p></p><p class=MsoNormal> 1514774 bytes in 20797 allocations in file devicestate.c<o:p></o:p></p><p class=MsoNormal> 1521524 bytes in 18237 allocations in file stasis.c<o:p></o:p></p><p class=MsoNormal> 2012008 bytes in 18969 allocations in file pbx.c<o:p></o:p></p><p class=MsoNormal> 3057408 bytes in 42464 allocations in file astobj2_hash.c<o:p></o:p></p><p class=MsoNormal> 4230560 bytes in 40320 allocations in file rtp_engine.c<o:p></o:p></p><p class=MsoNormal> 27781422 bytes in 577295 allocations in file stasis_cache.c<o:p></o:p></p><p class=MsoNormal> 28497984 bytes in 1495 allocations in file ../src/pj/pool_policy_malloc.c<o:p></o:p></p><p class=MsoNormal> 56621945 bytes in 1766936 allocations in file taskprocessor.c<o:p></o:p></p><p class=MsoNormal>160393938 bytes in 2227792 allocations in file stasis_message.c<o:p></o:p></p><p class=MsoNormal>440540801 bytes in 8647565 allocations in file json.c<o:p></o:p></p><p class=MsoNormal>3011728948 bytes in 2923317 allocations in file stasis_channels.c<o:p></o:p></p><p class=MsoNormal>3750730746 bytes allocated (69073 in caches) in 16358993 selected allocations<o:p></o:p></p><p class=MsoNormal>3750730746 bytes in all allocations<o:p></o:p></p><p class=MsoNormal>3751451731 bytes in all allocations and deferred free allocations<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>real 0m15.676s<o:p></o:p></p><p class=MsoNormal>user 0m0.006s<o:p></o:p></p><p class=MsoNormal>sys 0m0.005s<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>(one second per contact)<o:p></o:p></p><p class=MsoNormal>time rasterisk -x "pjsip show contacts"<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> Contact: <Aor/ContactUri..............................> <Hash....> <Status> <RTT(ms)..><o:p></o:p></p><p class=MsoNormal>==========================================================================================<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> Contact: 1123/sip:1123@X.X.X.X:42700;ob 82a79730c7 NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: 1124/sip:1124@X.X.X.X:12061;ob 056c670307 NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: 1130/sip:1130@X.X.X.X:14302;ob 2fccd6c498 NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: 1131/sip:1131@X.X.X.X:23729;ob 277dda2550 NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: 1132/sip:1132@X.X.X.X:12173;ob 71e2436f7e NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: 1136/sip:1136@X.X.X.X:10085;ob 93300d6b2a Unknown nan<o:p></o:p></p><p class=MsoNormal> Contact: 1138/sip:1138@X.X.X.X:14178;ob 9ac8eb538c NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: 1148/sip:1148@X.X.X.X:28858;ob 3f6f6eca2a NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: Reiner_Georgia/sip:X.X.X.X/24 5da85f3be0 NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: Reiner_texas/sip:X.X.X.X/24 5da85f3be0 NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: Reiner_texas_2/sip:X.X.X.X/24 5da85f3be0 NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: Whisl_Telecom/sip:X.X.X.135:5060 5d61346cde NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: fede_arg/sip:X.X.X.X a5993dc66d NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: iplink/sip:X.X.X.X 4fc2b9913d Avail 203.144<o:p></o:p></p><p class=MsoNormal> Contact: nueva_reiner/sip:X.X.X.X/24 5da85f3be0 NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: reiner colombia/sip:X.X.X.X/24 df94afc597 NonQual nan<o:p></o:p></p><p class=MsoNormal> Contact: reiner_colombia/sip:X.X.X.X/24 5da85f3be0 NonQual nan<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Objects found: 17<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>real 0m14.942s<o:p></o:p></p><p class=MsoNormal>user 0m0.003s<o:p></o:p></p><p class=MsoNormal>sys 0m0.004s<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>