[mapserver-users] high memory usage on map draw

Daniele Debernardi daniele at geosar.ch
Wed Nov 30 00:06:02 PST 2011


Tiling the map is a good idea, but the problem is the symbology and 
label that are drawn between 2 tiles,
with a buffer can't be possible why there is no possibility to know how 
the symbol or text will be.

I'm trying to configure php mapscript to output directly in pdf with 
CAIRO but with no success.

MapServer version 6.1-dev OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG 
SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=CAIRO SUPPORTS=FREETYPE 
SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT 
SUPPORTS=WFS_CLIENT SUPPORTS=GEOS INPUT=POSTGIS INPUT=OGR INPUT=GDAL 
INPUT=SHAPEFILE

setting output format driver CAIRO/PDF mimetype application/x-pdf 
imagemode RGB and extension pdf i get this error:

[MapServer Error]: msSaveRasterBuffer(): unsupported image format

Failed writing image to /tmp/4ed5e30c_4d9_0.pdf

In php i have the support of pdflib lite enabled (PDFlib GmbH Version 7.0.5)

Is there something particular in the configuration that I'm missing to 
get pdf output work correctly?

Thanks in advance

Daniele



Il 29.11.2011 19:00, Adam Eskreis ha scritto:
> Why don't you try requesting the images in a tile-based manner so that 
> the requests are managable, and then weave them together in your 
> software?  Mapserver isn't intended to pull in tiles that big.  You 
> should be able to pull in 2048x2048 tiles just fine.
>
> -Adam
>
> On Tue, Nov 29, 2011 at 10:51 AM, Stephen Woodbridge 
> <woodbri at swoodbridge.com <mailto:woodbri at swoodbridge.com>> wrote:
>
>     On 11/29/2011 10:02 AM, Daniele Debernardi wrote:
>
>         The solution is not pumping up the memory limit of the server,
>         because
>         if i get 2 request at the same time
>         I still have memory problem.
>
>
>     It sounds like you have not adequately sized the server for the
>     tasks you are asking it to perform. Mapserver is designed for
>     performance so that it can handle requests quickly and free up the
>     memory it is using for the next request. If you start swapping or
>     paging data to disk that slows down all processes and can
>     overwhelm the system with too many slow requests that are all
>     consuming memory and not exiting as fast as new requests are
>     coming in.
>
>     If you are making an enhancement request for say making mapserver
>     use less memory and temporary disk files or swap space at the cost
>     of performance, then you should add a ticket to the tracking
>     system. This is not a short term solution.
>
>
>         Which is the best way (output format) to generate high
>         resolution map
>         images with full symbology support?
>
>
>     I defer to Thomas on this one. But he has already mentioned that
>     probably doing something like direct pdf output and converting any
>     pixmap symbols into scalable symbols is the best way to go.
>
>     -Steve W
>
>
>         Il 29.11.2011 15:49, Stephen Woodbridge ha scritto:
>
>             On 11/29/2011 3:20 AM, Daniele Debernardi wrote:
>
>                 Hi,
>                 with mapserver trunk version (but i think with others
>                 too) I have to
>                 generate very big map to be imported in a pdf file.
>                 I use php mapscript to generate maps with 300 dpi for
>                 an A1/A0 pdf page
>                 or bigger.
>                 This mean that the map has dimensions like 15000x25000
>                 pxl and when I
>                 call the MapObj->draw method i get this error:
>
>                 PHP Warning: mapObj::draw(): [MapServer Error]:
>                 agg2CreateImage():
>                 mapagg.cpp: 708: Out of memory allocating 1550851152
>                 bytes.
>
>                 Map server is configured with the AGG/PNG driver with
>                 imagemode RGBA.
>
>                 Is it normal that need so much memory to generate the
>                 image?
>
>
>             Just for the image buffer you need 15000x25000x4 pixels =
>             1500,000,000
>             and AGG might actually allocate a slight larger image
>             buffer so it
>             does not create edge effects while antialiasing objects
>             close to the
>             edges. So the above request does not seem unreasonable.
>
>                 I already tryied the php ini_set memory_limit but with
>                 a limit of 2048M
>                 i still have some problem with memory.
>
>
>             Try setting the limit a little higher like to 2564-3072M
>             can see if
>             your memory problems go away. Of course this assumes you
>             have a system
>             with a lot of memory.
>
>             -Steve W
>
>                 I checked other possible outputs but generating maps
>                 in pdf through
>                 Cairo driver but doc says that polygons filled with
>                 symbols are not
>                 supported, and for that reason I cant use it.
>                 SVG output has some limitations too like line drawn
>                 without symbols or
>                 pixmap symbols not supported.
>
>                 Is there a better way to generate so big map images
>                 and imported in a
>                 pdf file?
>
>                 Hope you guys can help me.
>
>                 Daniele
>                 _______________________________________________
>                 mapserver-users mailing list
>                 mapserver-users at lists.osgeo.org
>                 <mailto:mapserver-users at lists.osgeo.org>
>                 http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>             _______________________________________________
>             mapserver-users mailing list
>             mapserver-users at lists.osgeo.org
>             <mailto:mapserver-users at lists.osgeo.org>
>             http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>
>     _______________________________________________
>     mapserver-users mailing list
>     mapserver-users at lists.osgeo.org
>     <mailto:mapserver-users at lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20111130/87eecbba/attachment.htm>


More information about the MapServer-users mailing list