[mapserver-users] static versus shared obj memory use

Richard Greenwood richard.greenwood at gmail.com
Fri May 15 14:34:56 PDT 2015


Thanks for the reply Andy. I had Googled a bit and found this stackoverflow
<http://stackoverflow.com/questions/2649334/difference-between-static-and-shared-libraries>
discussion in which the answer at the bottom said:

"The most significant advantage of shared libraries is that there is only
one copy of code loaded in memory, no matter how many processes are using
the library. For static libraries each process gets its own copy of the
code. This can lead to significant memory wastage."

But I'm not sure if that's applicable with a web/fcgi application.

rich

On Fri, May 15, 2015 at 3:04 PM, Andy Colson <andy at squeakycode.net> wrote:

> On 5/15/2015 3:59 PM, Richard Greenwood wrote:
>
>> I'm working on Linux and have statically linked mapserv for convenience
>> but now I'm wondering if it is adversely affecting memory use. For
>> example, if I have five fcgi mapserv instance like:
>>    mapserv.fcgi?map=mapfile1.map
>>    mapserv.fcgi?map=mapfile2.map
>>    mapserv.fcgi?map=mapfile3.map
>>    mapserv.fcgi?map=mapfile4.map
>>    mapserv.fcgi?map=mapfile5.map
>> Am I using more memory with my static build than if they all referencing
>> the shared libmapserver.so?
>>
>> Thanks,
>> rich
>>
>>
> I believe you will pay for the cost of one executable, the others will
> share the code pages, but get their own data pages.
>
> So no, you probably are not using more memory using static build.
>
> -Andy
>
>


-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150515/cd7b6d6e/attachment.htm>


More information about the MapServer-users mailing list