[OpenSIPS-Users] Private Memory vs Shared Memory

Anca Vamanu anca at opensips.org
Sat Nov 20 14:26:45 CET 2010


Hi Sven,

On 18/11/10 17:00, Sven Schulz wrote:
> Just a few generic questions: What is the difference between shared 
> and private memory in opensips? 
Private memory is the memory used by one process, while shared memory is 
memory accessible by all processes (it is an IPC method, see 
http://en.wikipedia.org/wiki/Shared_memory). The private memory is used 
for temporary storages required for certain processing by a process, 
while the shared memory is used to store data that must be accessible by 
all processes.
> And how does each relate to the child processes?
When you set the private memory(by editing config.h) it means that each 
process will have that amount of private memory. What you set with -m 
parameter when starting opensips is the entire chunk of shared memory 
that will be used. OpenSIPS has an internal memory management system - 
and it allocates all the required memory at startup - so 
no_of_children*pkg_mem private memory and shm_mem shared memory and from 
these chuncks allocated at startup it gives to the processes pieces when 
they ask for it with pkg_malloc or shm_malloc.
> Also, is there a good guideline to what these should be set in 
> relation to how much RAM is installed.
You must have at least RAM as no_of_children*pkg_mem + shm_mem.

Regards,

-- 
Anca Vamanu
www.voice-system.ro


> Thanks,
>
> Sven Schulz
> Penn State University
> Telecommunications and Network Services
> 814.865.6116
> sip:sven at psu.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20101120/6a8deeb2/attachment.htm>


More information about the Users mailing list