Hi all,
Can anyone give me some info on what this warning means:
Jul 7 17:02:29 csbc02 csbc[16006]: WARNING: <core> [core/daemonize.c:596]: mem_lock_pages(): failed to lock the memory pages (disable swap): Cannot allocate memory [12]
Yes, if I set mlock_pages=no I don't see the warning, but I'm trying to understand why can't it allocate with mlock_pages=yes.
Joel.
https://github.com/kamailio/kamailio/blob/21afc6081c3044b4f754e6a34ea67fd98f...
On Tue, 7 Jul 2020 at 23:17, Joel Serrano joel@textplus.com wrote:
Hello,
check process capabilities (if EOMEM is errno 12 in your installation as well): Errors ENOMEM (Linux 2.6.9 and later) the caller had a nonzero RLIMIT_MEMLOCK soft resource limit, but tried to lock more memory than the limit permitted. This limit is not enforced if the process is privileged (CAP_IPC_LOCK). Cheers,
Henning
-- Henning Westerholt – https://skalatan.de/blog/ Kamailio services – https://gilawa.comhttps://gilawa.com/
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Joel Serrano Sent: Wednesday, July 8, 2020 12:16 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: [SR-Users] failed to lock the memory pages (disable swap) WARNING
Hi all,
Can anyone give me some info on what this warning means:
Jul 7 17:02:29 csbc02 csbc[16006]: WARNING: <core> [core/daemonize.c:596]: mem_lock_pages(): failed to lock the memory pages (disable swap): Cannot allocate memory [12]
Yes, if I set mlock_pages=no I don't see the warning, but I'm trying to understand why can't it allocate with mlock_pages=yes.
Joel.
Hey guys, I never replied back but thankfully didn’t forget.
I finally got some time to finish checking this, as you guys pointed out, my only issue was the limits.
If anyone else runs into this:
To /etc/security/limits.conf (and reboot):
* hard memlock unlimited * soft memlock unlimited
If you are using systemd based OS:
To Kamailio systemd unit file/drop-in overrides, in [Service] section:
LimitMEMLOCK=infinity
Thanks Henning and David!
Cheers, Joel.
On Tue, Jul 7, 2020 at 23:17 Henning Westerholt hw@skalatan.de wrote:
Hello,
thanks for updating back, very useful to know.
Btw, both updates of /etc/security/limits.conf and systemd unit file are required, or only one is enough?
Cheers, Daniel
On 24.07.20 16:46, Joel Serrano wrote: