[OpenSIPS-Users] Can we disable pre-allocation of memory?

Liviu Chircu liviu at opensips.org
Fri May 20 10:35:25 CEST 2016


Hi surya,

The Linux kernel will not immediately reserve the big chunk of memory 
OpenSIPS requests on startup (depleting your overall system memory), but 
rather it will break it into pieces of 4096 bytes called "pages", and 
carefully link/unlink each page to "4096" bytes of physical RAM as your 
OpenSIPS server does any kind of memory-related processing.

Time for theory in action! My dev environment only has 6 GB of RAM, but 
Linux allows OpenSIPS to start even if it requests 8GB of shared memory 
+ another 4.6GB of pkg memory (512 x 9). That's ~ 13GB - more than 
double my physical memory!

[liviu ◄ Rivendell opensips (master)]
$ ./opensips -m8192 -M512 -f etc/opensips_2_2.cfg -w . &> log
[liviu ◄ Rivendell opensips (master)]
$ ps aux | grep opensi
liviu     3495  0.6  0.1 9002472 6148 ?        S    11:25   0:00 
./opensips -m8192 -M512 -f etc/opensips_2_2.cfg -w .
liviu     3496  0.0  0.0 9081648 2968 ?        S    11:25   0:00 
./opensips -m8192 -M512 -f etc/opensips_2_2.cfg -w .
liviu     3497  0.0  0.0 9081644 2964 ?        S    11:25   0:00 
./opensips -m8192 -M512 -f etc/opensips_2_2.cfg -w .
liviu     3499  0.0  0.0 9002472 1648 ?        S    11:25   0:00 
./opensips -m8192 -M512 -f etc/opensips_2_2.cfg -w .
liviu     3500  0.0  0.0 9002472 1648 ?        S    11:25   0:00 
./opensips -m8192 -M512 -f etc/opensips_2_2.cfg -w .
liviu     3502  0.0  0.0 9081644 3456 ?        S    11:25   0:00 
./opensips -m8192 -M512 -f etc/opensips_2_2.cfg -w .
liviu     3504  0.0  0.0 9081644 2976 ?        S    11:25   0:00 
./opensips -m8192 -M512 -f etc/opensips_2_2.cfg -w .
liviu     3505  0.0  0.0 9081644 3468 ?        S    11:25   0:00 
./opensips -m8192 -M512 -f etc/opensips_2_2.cfg -w .
liviu     3507  0.0  0.0 9081644 2976 ?        S    11:25   0:00 
./opensips -m8192 -M512 -f etc/opensips_2_2.cfg -w .
liviu     3523  0.0  0.0  20396   972 pts/15   S+   11:25   0:00 grep 
--color=auto opensi
liviu     7019  0.0  0.0  50968  4504 pts/4    S+   mai19   0:00 vim 
etc/opensips_2_2.cfg
[liviu ◄ Rivendell opensips (master)]
$ cat /proc/meminfo
MemTotal:        5995856 kB

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 20.05.2016 01:51, surya wrote:
> Hi,
>
> Just a simple question. can we disable the pre-allocation of memory and
> allow use of whatever memory is available?
>
> Thanks
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Can-we-disable-pre-allocation-of-memory-tp7603033.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list