[MAPSERVER-USERS] Memoryproblem

BrainDrain paulborodaev at gmail.com
Wed Aug 13 01:56:09 EDT 2008


I use mapscript c# in my project running in ms win 2003 std/ent r2 and iis6
all works perfect, but some problem related with writing png's exists in
.net (v 2/3.5)

imageObj imgRaw=null;
imgRaw = map.draw();
//this works (without changing image format)
using (MemoryStream ms = new MemoryStream(imgRaw.getBytes()))
ms.WriteTo(response.OutputStream);
//or this (note: the second memory stream,actually, needed only for
iutputing png's!)
imageFormat = ImageFormat.Png;
using (Image img = Image.FromStream(new MemoryStream(imgRaw.getBytes())))
{
 using (MemoryStream ms = new MemoryStream())
 {   
  img.Save(ms, imageFormat);
  ms.WriteTo(response.OutputStream);
 }
}
before version 5.2 I had memory corruption problems in some web service
requests (reason - unknown, perhaps it was related with postgis bug - ticket
now closed) during map.draw(), but now all ok. 
+consideration: mapserv.exe (especially in fastcgi mode) much more faster


Hallgren, Johan wrote:
> 
> Hello
> 
> I have a major problem when using imgMapObj.getBytes().
> 
> The memory will be corrupt. The problem doesn't occur when using the save
> function.  I have not seen the problem on other servers so the problem
> seams to be related to a specific server (Windows Server 2003 standard
> edition).
> 
> Error msg
> 
> ++++++++++++++++++++++
> 
> Attempted to read or write protected memory. This is often an indication
> that other memory is corrupt.
> 
>    at OSGeo.MapServer.mapscriptPINVOKE.imageObj_getBytes(HandleRef jarg1,
> SWIGByteArrayDelegate jarg2)
>    at OSGeo.MapServer.imageObj.getBytes(SWIGByteArrayDelegate callback)
>    at OSGeo.MapServer.imageObj.getBytes()
>    at WMData.GIS.GMSAgent_WP.Libs.MapEngine.Get_Image(XmlDocument xmlDoc,
> Boolean bRetImage) in
> C:\Project\applications\GMS\GMSAgent_WP\Libs\MapEngine.cs:line 298
> ++++++++++++++++++++++
> 
> I use mapserver in c# and I have version 5.2.0.
>  /Johan
> Johan Hallgren
> Logica
> Pelle Bergs backe 3
> Box 1938, 791 19 Falun
> Tel (och mobil): 023-547 46 (int: +46-2354746)
> johan.hallgren at logica.com<mailto:johan.hallgren at logica.com>
> http://www.logica.se<http://www.logica.se/>
> 
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Memoryproblem-tp18940658p18957433.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list