<p>this can be reporduced by following lua config<br>
kamailio.cfg</p>
<pre><code>#!KAMAILIO
####### Defined Values #########

#!substdef "!MY_IP_ADDR!<MY_IP>!g"
#!substdef "!MY_EXTERNAL_IP!<MY_EXTERNAL_IP>!g"
#!substdef "!MY_UDP_PORT!5060!g"
#!substdef "!MY_UDP_ADDR!udp:MY_IP_ADDR:MY_UDP_PORT!g"

# Dispatcher File
#!define DISPATCHER_FILE "/etc/kamailio/dispatcher.list"

# Routing File
#!define ROUTE_LUA "/etc/kamailio/route.lua"

####### Global Parameters #########

## LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR
#!ifdef WITH_DEBUG
debug = 4
log_stderror = yes
#!else
debug = 2
log_stderror = no
#!endif

memdbg = 5
memlog = 5

# log setting
log_facility = LOG_LOCAL0

listen = MY_UDP_ADDR advertise MY_EXTERNAL_IP:MY_UDP_PORT

children = 8
async_workers=8

####### Modules Section ########
#!ifdef WITH_SRCPATH
mpath = "modules/"
#!else
mpath = "/usr/local/lib64/kamailio/modules/"
#!endif
# ------------------ module loading ----------------------------------
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "maxfwd.so"
loadmodule "nathelper.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "path.so"
loadmodule "jsonrpcs.so"
loadmodule "app_lua.so"
loadmodule "dispatcher.so"
loadmodule "json.so"
loadmodule "cfg_rpc.so"
loadmodule "ctl.so"

# ----------------- setting module-specific parameters ---------------

# ----- rr params -----
# set next param to 1 to add value to ;lr param (helps with some UAs)
modparam("rr", "enable_full_lr", 0)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 1)

# ----- dispatcher params -----
modparam("dispatcher", "list_file", DISPATCHER_FILE)
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "ds_ping_interval", 10)

modparam("dispatcher", "ds_ping_from", "sip:ping@test.my.com")

# ----- nathelper params ----
modparam("nathelper", "received_avp", "$avp(s:rcv)")

# ----- ctl ------
modparam("ctl", "binrpc", "tcp:MY_IP_ADDR:2046")

# ----- app_lua params ----
modparam("app_lua", "reload", 1)
modparam("app_lua", "load", ROUTE_LUA)


# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3)
modparam("tm", "fr_timer", 5000)
modparam("tm", "fr_inv_timer", 120000)
modparam("tm", "restart_fr_on_each_reply", 1)
modparam("tm", "pass_provisional_replies", 1)
modparam("tm", "contacts_avp", "tm_contacts");
modparam("tm", "contact_flows_avp", "tm_contact_flows");

cfgengine "lua"


route.lua
</code></pre>
<p>function ksr_request_route()<br>
local request_method = headers.get("$rm") or "";<br>
local user_agent = headers.get("$ua") or "";<br>
KSR.info("recieve request " .. request_method);<br>
KSR.exit();<br>
return 1;<br>
end</p>
<pre><code></code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1577#issuecomment-404720655">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZdTArJn4SKvFN9hRqyqepRl30ETDks5uGB6ugaJpZM4U9gZo">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZdRaBUfYGQgX1uYeW2GOA4jQqDnjks5uGB6ugaJpZM4U9gZo.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@surendratiwari3 in #1577: this can be reporduced by following lua config\r\nkamailio.cfg\r\n\r\n```\r\n#!KAMAILIO\r\n####### Defined Values #########\r\n\r\n#!substdef \"!MY_IP_ADDR!\u003cMY_IP\u003e!g\"\r\n#!substdef \"!MY_EXTERNAL_IP!\u003cMY_EXTERNAL_IP\u003e!g\"\r\n#!substdef \"!MY_UDP_PORT!5060!g\"\r\n#!substdef \"!MY_UDP_ADDR!udp:MY_IP_ADDR:MY_UDP_PORT!g\"\r\n\r\n# Dispatcher File\r\n#!define DISPATCHER_FILE \"/etc/kamailio/dispatcher.list\"\r\n\r\n# Routing File\r\n#!define ROUTE_LUA \"/etc/kamailio/route.lua\"\r\n\r\n####### Global Parameters #########\r\n\r\n## LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR\r\n#!ifdef WITH_DEBUG\r\ndebug = 4\r\nlog_stderror = yes\r\n#!else\r\ndebug = 2\r\nlog_stderror = no\r\n#!endif\r\n\r\nmemdbg = 5\r\nmemlog = 5\r\n\r\n# log setting\r\nlog_facility = LOG_LOCAL0\r\n\r\nlisten = MY_UDP_ADDR advertise MY_EXTERNAL_IP:MY_UDP_PORT\r\n\r\nchildren = 8\r\nasync_workers=8\r\n\r\n####### Modules Section ########\r\n#!ifdef WITH_SRCPATH\r\nmpath = \"modules/\"\r\n#!else\r\nmpath = \"/usr/local/lib64/kamailio/modules/\"\r\n#!endif\r\n# ------------------ module loading ----------------------------------\r\nloadmodule \"tm.so\"\r\nloadmodule \"rr.so\"\r\nloadmodule \"pv.so\"\r\nloadmodule \"tmx.so\"\r\nloadmodule \"sl.so\"\r\nloadmodule \"maxfwd.so\"\r\nloadmodule \"nathelper.so\"\r\nloadmodule \"textops.so\"\r\nloadmodule \"siputils.so\"\r\nloadmodule \"xlog.so\"\r\nloadmodule \"sanity.so\"\r\nloadmodule \"path.so\"\r\nloadmodule \"jsonrpcs.so\"\r\nloadmodule \"app_lua.so\"\r\nloadmodule \"dispatcher.so\"\r\nloadmodule \"json.so\"\r\nloadmodule \"cfg_rpc.so\"\r\nloadmodule \"ctl.so\"\r\n\r\n# ----------------- setting module-specific parameters ---------------\r\n\r\n# ----- rr params -----\r\n# set next param to 1 to add value to ;lr param (helps with some UAs)\r\nmodparam(\"rr\", \"enable_full_lr\", 0)\r\n# do not append from tag to the RR (no need for this script)\r\nmodparam(\"rr\", \"append_fromtag\", 1)\r\n\r\n# ----- dispatcher params -----\r\nmodparam(\"dispatcher\", \"list_file\", DISPATCHER_FILE)\r\nmodparam(\"dispatcher\", \"ds_probing_mode\", 1)\r\nmodparam(\"dispatcher\", \"flags\", 2)\r\nmodparam(\"dispatcher\", \"ds_ping_interval\", 10)\r\n\r\nmodparam(\"dispatcher\", \"ds_ping_from\", \"sip:ping@test.my.com\")\r\n\r\n# ----- nathelper params ----\r\nmodparam(\"nathelper\", \"received_avp\", \"$avp(s:rcv)\")\r\n\r\n# ----- ctl ------\r\nmodparam(\"ctl\", \"binrpc\", \"tcp:MY_IP_ADDR:2046\")\r\n\r\n# ----- app_lua params ----\r\nmodparam(\"app_lua\", \"reload\", 1)\r\nmodparam(\"app_lua\", \"load\", ROUTE_LUA)\r\n\r\n\r\n# ----- tm params -----\r\n# auto-discard branches from previous serial forking leg\r\nmodparam(\"tm\", \"failure_reply_mode\", 3)\r\nmodparam(\"tm\", \"fr_timer\", 5000)\r\nmodparam(\"tm\", \"fr_inv_timer\", 120000)\r\nmodparam(\"tm\", \"restart_fr_on_each_reply\", 1)\r\nmodparam(\"tm\", \"pass_provisional_replies\", 1)\r\nmodparam(\"tm\", \"contacts_avp\", \"tm_contacts\");\r\nmodparam(\"tm\", \"contact_flows_avp\", \"tm_contact_flows\");\r\n\r\ncfgengine \"lua\"\r\n\r\n\r\nroute.lua\r\n```\r\n\r\nfunction ksr_request_route()\r\n    local request_method = headers.get(\"$rm\") or \"\";\r\n    local user_agent = headers.get(\"$ua\") or \"\";\r\n    KSR.info(\"recieve request \" .. request_method);\r\n    KSR.exit();\r\n    return 1;\r\nend\r\n\r\n```"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1577#issuecomment-404720655"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1577#issuecomment-404720655",
"url": "https://github.com/kamailio/kamailio/issues/1577#issuecomment-404720655",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [kamailio/kamailio] MemoryUtilization getting increase with lua routing (#1577)",
"sections": [
{
"text": "",
"activityTitle": "**Surendra Tiwari**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@surendratiwari3",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1577,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1577\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1577#issuecomment-404720655"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 351667816\n}"
}
],
"themeColor": "26292E"
}
]</script>