RE: [mapserver-users] Memoryproblem

2008-08-13 Thread Hallgren, Johan
 Falun
Tel (och mobil): 023-547 46 (int: +46-2354746)
[EMAIL PROTECTED]
http://www.logica.se

-Original Message-
From: Tamas Szekeres [mailto:[EMAIL PROTECTED]
Sent: den 13 augusti 2008 15:36
To: Hallgren, Johan
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Memoryproblem

Johan,

I wonder if this was a Win 2003 issue, since all of the windows builder are 
running on Win 2003 at the buildbot and the build process includes testing the 
getBytes function.

How is your mapfile looking like? Which mapserver version are you testing with.


Tamas



2008/8/13 Hallgren, Johan [EMAIL PROTECTED]:
 Hello Tamas

 I'm glad that you supports me here:)

 We are getting closer to the problem:)

 Your code (getbytes.exe) runs fine on my own pc, but when I move the code to 
 the server the problem starts.

 I made a new project with your cs-file and named it getbytemap, but it's 
 actually the same code as the getbytes.exe. The output below doesn't actually 
 write the error but the GetBytes: is the first part och the exception 
 message. I can guess that the memory already is corrupt. When I do the same 
 with the debugger you can see the watch output below.

 One difference I have in mind compared to other environments I have used is 
 that this server have more power. In the task manager there is eight CPUs.

 The problem is deterministic with the getbyte-code.

 Console output
 +++
 C:\tempgetbytemap.exe D:\apps\GMSAgent\MapFiles\gims.map
 c:\temp\t.png Drawing map: 'GIMS' using imageObj.getBytes
 GetBytes:

 C:\tempgetbytemap.exe D:\apps\GMSAgent\MapFiles\gims.map
 c:\temp\t.png Drawing map: 'GIMS' using imageObj.getBytes Drawing map:
 'GIMS' using imageObj.write
 GetBytes:

 C:\tempgetbytemap.exe D:\apps\GMSAgent\MapFiles\gims.map
 c:\temp\t.png Drawing map: 'GIMS' using imageObj.getBytes
 GetBytes:

 C:\tempgetbytemap.exe D:\apps\GMSAgent\MapFiles\gims.map
 c:\temp\t.png Drawing map: 'GIMS' using imageObj.getBytes
 GetBytes:

 C:\tempgetbytemap.exe D:\apps\GMSAgent\MapFiles\gims.map
 c:\temp\t.png Drawing map: 'GIMS' using imageObj.getBytes
 GetBytes:
 +++

 Watch output
 +++
 ex.Message  Attempted to read or write protected memory. This is often 
 an indication that other memory is corrupt.string
 +++

 /Johan

 ___


 Johan Hallgren


 Logica
 Pelle Bergs backe 3
 Box 1938, 791 19 Falun
 Tel (och mobil): 023-547 46 (int: +46-2354746)
 [EMAIL PROTECTED] http://www.logica.se

 -Original Message-
 From: Tamas Szekeres [mailto:[EMAIL PROTECTED]
 Sent: den 12 augusti 2008 16:48
 To: Hallgren, Johan
 Cc: mapserver-users@lists.osgeo.org
 Subject: Re: [mapserver-users] Memoryproblem

 Johan,

 I haven't run into this problem yet. Do you able to run the getbytes console 
 application in the /csharp directory?
 Is this issue deterministic or random? Do you have an example to reproduce it?

 Best regards,

 Tamas


 2008/8/12 Hallgren, Johan [EMAIL PROTECTED]:
 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)
 [EMAIL PROTECTED] http://www.logica.se


 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users





___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Memoryproblem

2008-08-12 Thread Tamas Szekeres
Johan,

I haven't run into this problem yet. Do you able to run the getbytes
console application in the /csharp directory?
Is this issue deterministic or random? Do you have an example to reproduce it?

Best regards,

Tamas


2008/8/12 Hallgren, Johan [EMAIL PROTECTED]:
 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)
 [EMAIL PROTECTED]
 http://www.logica.se


 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MAPSERVER-USERS] Memoryproblem

2008-08-12 Thread BrainDrain

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)
 [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]
 http://www.logica.sehttp://www.logica.se/
 
 
 ___
 mapserver-users mailing list
 mapserver-users@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.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users