ThinkGeo.com    |     Documentation    |     Premium Support

BingMapsLayer Server 2012

Hello,



We have our MapSuite desktop 8 project running on 2 Windows 2008 servers and 1 Windows 2012 server. We use Bing Maps in the project and it works nicely on the 2008 servers with no issues. On the Windows 2012 server it works sometimes and others we get the RedX. I can switch between the map modes and it’ll change on some and others give the RedX. Same with zooming. I will zoom in a couple times and it works fine but then hit a RedX. if i zoom back once and forward again it’ll work.

I did try changing it to use the BingMapsOverlay and we get less RedXs but still frequent. 

Have you had other issues like this with 2012 server? Is there any direction you could give to get it working correctly? 



Thanks,

Jesse Mabon

I have an update. I changed it to Throw Exception and get the following error. Again, sometimes it shows BING and others we get this error: 
  
 ERROR: Out of memory. 
 CALL STACK:    at ThinkGeo.MapSuite.Core.BingMapsLayer.2Uc=(Int32 hXM=, Int32 hnM=, Int32 h3M=, Int32 iHM=) 
    at ThinkGeo.MapSuite.Core.BingMapsLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers) 
    at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers) 
    at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas) 
    at ThinkGeo.MapSuite.DesktopEdition.Overlay.ZxQ=(GeoCanvas aBQ=) 
    at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas) 
    at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.shM=(IEnumerable`1 VRc=, RectangleShape Vhc=) 
    at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.sBM=(RectangleShape Uxc=, RectangleShape VBc=) 
    at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.9xM=(RectangleShape jRc=) 
    at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh() 
  
 I’m not sure how it could be Out of Memory, it’s a nicer server than the Windows 2008 servers we have. 
  
 Thanks, 
 Jesse 


Hi Jesse,



Sorry I can’t reproduce this issue on my virtual machine Windows Server 2012. The RedX means that an exception throws in the application.  In Desktop edition the exception will be rendered as a RedX if the DrawingExceptionMode = DrawingExceptionMode.DrawException. Please try using the following overlay to get more information about the exception and confirm where is the exception throws, whether it’s caused by our product or not.




namespace ThinkGeo.MapSuite.DesktopEditionExtension
{
    public class LayerOverlayWithException : LayerOverlay
    {
        public LayerOverlayWithException()
        {
            DrawingExceptionMode = DrawingExceptionMode.DrawException;
        }
 
        protected override void DrawExceptionCore(GeoCanvas canvas, Exception e)
        {
            base.DrawExceptionCore(canvas, e); // Get the exception message here.
        }
    }
}

Have any questions please let me know.



Thanks,

Peter

OK, i will try this as well to see if I get a different error, but did you see my second post? I had already trapped the error I am getting. Is there something i can modify in code or on the server to fix the Out of Memory error? Our server has plenty of memory so it must be something else.



Thanks,

Jesse 

Hi Jesse, 
  
 Yes, I saw the second post before, as I mentioned that I’m sorry that I was unable to reproduce these issues on my virtual machine. I ran the sample again and failed to reproduce these issues. I think you can get more information according to the way I suggested in the last reply. Please try referencing the latest version of 9.0, a few months ago, we fixed an issue of OutOfMemoryException. 
  
 Waiting for the further information from you. 
  
 Thanks, 
 Peter

Peter,



I have implemented the Exception layer and get the same results. It now says “Out of memory” instead of the RedX. Again, this shows the Bing layer some times as you zoom in/out or pan around and then will throw this error and then start working again. It’s all the same code and project that is currently working fine on our windows 2008 servers as well as all our local machines. 



ERROR: Out of memory.


CALL STACK:    at ThinkGeo.MapSuite.Core.BingMapsLayer.2Uc=(Int32 hXM=, Int32 hnM=, Int32 h3M=, Int32 iHM=)


   at ThinkGeo.MapSuite.Core.BingMapsLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)


   at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)


   at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)


   at ThinkGeo.MapSuite.DesktopEdition.Overlay.ZxQ=(GeoCanvas aBQ=)


   at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)



Hi Jesse,  
  
 It looks that thrown when the layer want to build a new RectangleShape, I don’t think this operation will cause the out of memory. 
  
 I think maybe you can do some test like this, override the DrawCore after inherit from BingMapsLayer, then add code to monitor the memory usage for current process and print out more information in DrawCore. Then we can see whether there is a memory leak here and whether special area requirement cause this exception. 
  
 And it looks that only thrown in 2012 but no 2008, I think maybe that’s related with the memory limitation for standalone application in your two servers, the new RectangleShape just be the last hit, so you can do further research on the server setting, we will do some search about that also. 
  
 Regards, 
  
 Don

Hello Don,

I have finally had to revisit this issue since we are attempting to upgrade our production servers to 2012. We currently have the same issue and i was hoping to find a resolution. I have created an override for the DrawCore using the BingMapsLayer and it still gives me the same Out of Memory error message. It does however allow me to just blank out the BingMapsLayer instead of the whole map.

I have monitored the memory on the server and there is more than enough memory and it does not increase as i’m zooming with Bing. We have no memory limitations set for our 2012 servers and i don’t think it is a memory issue at all. Here is a screencast video of the behavior we’re getting: Screencast. Each time you see the BingMaps clear out is when the DrawExceptionCore happens. I currently have it not drawing any error message.

This is happening on both our 2012 physical servers and not on any of our 2008 servers. We do have a 2012 virtual server setup for testing and it does not happen on the VM. So if you’re trying to reproduce it on a VM we’ve found that it only happens on a physical server. It also sometimes takes a few minutes of zooming in and out before you see the issue.

I have turned off caching to see if that is the issue and it still happens. I have also downloaded and upgraded to version 9 evaluation and it happens with it as well. I am at a loss and really need this to work on our 2012 servers.

Please help,
Jesse Mabon

Hi Jesse,

That’s strange because it only can reproduce on Server 2012 physical server.

For research it I think we need some more information, could you please reply the following questions?

  1. What the installed .NET framework version?
  2. What’s the dll version number?
  3. You debug on this machine or run your project on it?
  4. I didn’t see exception from this video, could you please sent the exception screen shot and give us the exception call stack?
  5. Please remove shapefile layers from your project and only keep bingmap layer then try again, we need to make sure it is bing layer issue or caused by other layers.
  6. Try to create one sample only contains bing layer which can recreate this issue.

Regards,

Don

Hello Don,

Thanks for your reply. Here are my answers to your list:

  1. The project is using version 4.5. I tried it with version 4.6.1 and got the same behavior.
  2. dll version is 8.0.0.113. However, i got the same behavior using the version 9 eval dlls
  3. We don’t have a debug environment setup on the server. Just running the exe
  4. Here is the exception and call stack:
    System.OutOfMemoryException: Out of memory.
    at ThinkGeo.MapSuite.Core.BingMapsLayer.2Uc=(Int32 hXM=, Int32 hnM=, Int32 h3M=, Int32 iHM=)
    at ThinkGeo.MapSuite.Core.BingMapsLayer.DrawCore(GeoCanvas canvas, Collection1 labelsInAllLayers) at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection1 labelsInAllLayers)
  5. I have created a project with just Bing and I get the same error. You have to zoom in/out for a couple minutes sometimes to get it to start.
  6. See attached project.

BingServer2012.zip (2.8 MB)

Thanks,
Jesse

Hi Jesse,

The V8 code is much difference with our currently version, so we cannot fixed possible bug based on 8.0 version.

Our developer build a new sample based on with the latest trial version 9.0.695.0, please download it and test to see whether the issue still exist. WindowsFormsApp1.zip (2.4 MB)

If the issue is fixed, please upgrade your code to use latest 9.0, and track the difference between the simplified code and yours.

If the issue still exist please also let us know, we will do further test based on our 9.0 version.

Regards,

Don

Hello Don,

I still get the same issue using your sample project. Here is a screenshot of the error and the Exception Text:

************** Exception Text **************
System.OutOfMemoryException: Out of memory.
at ThinkGeo.MapSuite.Core.BingMapsLayer.bCw=(Int32 startTileX, Int32 startTileY, Int32 endTileX, Int32 endTileY, Int32 zoomlevelNumber)
at ThinkGeo.MapSuite.Core.BingMapsLayer.DrawCore(GeoCanvas canvas, Collection1 labelsInAllLayers) at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection1 labelsInAllLayers)
at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.4BQ=(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.qhU=(IEnumerable`1 drawingOverlays, RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.qBU=(RectangleShape drawingExtent, RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.yhU=(RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xxU=(Int32 delayInterval, RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh()
at WindowsFormsApp1.Form1.WinformsMap1_MouseWheel(Object sender, MouseEventArgs e) in C:\DEVELOP\MTC\BingServer2012\v9Sample\WindowsFormsApp1\Form1.cs:line 51
at System.Windows.Forms.MouseEventHandler.Invoke(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseWheel(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseWheel(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Thanks,
Jesse

Hi Jesse,

We prepare a physical machine today, we tested on that. But we still hadn’t reproduce it.

So we think you should want to do something as below:

  1. We want another video, it should shows how you operate the map, contains all the steps, and contains the moment when the exception is thrown.

  2. Could you please try another machine which with same setting? Our developer doubt whether it’s related with this machine you are using.

Regards,

Don

Hello Don,

Here is another video on our 2nd 2012 server. The steps are simple. I launch the sample project and begin to use the mouse wheel to zoom in and out. You’ll see the exception windows pop up during the process. The first one is about 30 seconds in.

ScreenCast

Thanks,
Jesse

Hi Jesse,

Please try to replace your cache with FileBitmapTileCache like this:

objLayer.TileCache = new FileBitmapTileCache(“BingMaps”);

And then test that with the 9.0.701.0 or higher version (you can get that in one or two days from our product center).

We did some change in this version, if you still met this issue, please try to set cache equal null for further test.

objLayer.TileCache = null;

If set cache equal null still have this issue, please let us know.

Regards,

Don