<p>Few remarks here ...</p>
<p>As a matter of fact, if an external library doesn't require shared memory, leave it as it is, without enforcing Kamailio's pkg memory.</p>
<p>I looked over time to several libs used by different Kamailio modules, most of them are using anyhow malloc/free for what is not expected to be shared memory. Also, I found that is not easy to predict how much private memory an external lib may need, so that is impacted if enforcing pkg, resulting bad runtime behaviour. We actually never tried to enforce pkg to external libs (e.g., like mysql or postgres clients, redis/mongodb, ...).</p>
<p>If needed to use shared memory, then it is a must to set our shm memory manager for external libs. We have to do it for TLS, because the connections are shared among Kamailio workers.</p>
<p>Otherwise, PKG must be used for the code written in Kamailio.</p>

<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/pull/1823#issuecomment-458522067">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZQW56tXAbvDPV1HRU8R5I9ZXanFjks5vID50gaJpZM4aUmOj">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZTb_jRA1C3jGZkkIYYFDJNVeSUr2ks5vID50gaJpZM4aUmOj.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://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1823: Few remarks here ...\r\n\r\nAs a matter of fact, if an external library doesn't require shared memory, leave it as it is, without enforcing Kamailio's pkg memory.\r\n\r\nI looked over time to several libs used by different Kamailio modules, most of them are using anyhow malloc/free for what is not expected to be shared memory. Also, I found that is not easy to predict how much private memory an external lib may need, so that is impacted if enforcing pkg, resulting bad runtime behaviour. We actually never tried to enforce pkg to external libs (e.g., like mysql or postgres clients, redis/mongodb, ...).\r\n\r\nIf needed to use shared memory, then it is a must to set our shm memory manager for external libs. We have to do it for TLS, because the connections are shared among Kamailio workers.\r\n\r\nOtherwise, PKG must be used for the code written in Kamailio."}],"action":{"name":"View Pull Request","url":"https://github.com/kamailio/kamailio/pull/1823#issuecomment-458522067"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/1823#issuecomment-458522067",
"url": "https://github.com/kamailio/kamailio/pull/1823#issuecomment-458522067",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>