ThinkGeo.com    |     Documentation    |     Premium Support

Memory consumption with release 14

Hi,

It seems that from some reason from release 14.0.0 onwards using MapView::PanByOffsetAsync() (also RefreshAsync() with same behaviour is observed) causes memory consumption to increase on every call to that method. This can be re-produced with following test code:

private async void mapView_Loaded(object sender, RoutedEventArgs e)
{
        // Set the Map's Unit to Meter.
        Map = sender as MapView;
        Map.MapClick += (sender, args) => MapMouseClick(args);
        Map.MapUnit = GeographyUnit.Meter;

        // Set the Current Extent to the Max Extent of ThinkGeo Map.
        Map.CurrentExtent = MaxExtents.ThinkGeoMaps;

        // Add a base map overlay.
        var baseOverlay = new ThinkGeoCloudRasterMapsOverlay("AOf22-EmFgIEeK4qkdx5HhwbkBjiRCmIDbIYuP8jWbc~",
        "xK0pbuywjaZx4sqauaga8DMlzZprz0qQSjLTow90EhBx5D8gFd2krw~~", ThinkGeoCloudRasterMapsMapType.Light_V1_X1);

        // Set up the tile cache for the base overlay, passing in the location and an ID to distinguish the cache.    
        baseOverlay.TileCache = new FileRasterTileCache(@".\cache", "basemap");
        baseOverlay.DrawingExceptionMode = DrawingExceptionMode.DrawException;
        // Add the newly created overlay to mapView.
        Map.Overlays.Add(baseOverlay);
        // Refresh the Map
        await Map.RefreshAsync();
}

private async Task MapMouseClick(MapClickMapViewEventArgs args)
{
    await Map.PanByOffsetAsync(0d, 0d);
}

Every time map is clicked memory consumption increases. In application where there are many overlayers and layers increase can be hundreds of MB’s on every call. It seems that memory is properly released if you e.g zoom in/out. But without it memory is not released.

Could you please check the reason for this behaviour ? Is there a memory leak somewhere ? With release 13.2.0 and same test code there are no memory issues.

Br, Simo

Hi Simo,

Thanks for letting us know. This issue has been fixed in the latest beta 14.3.0-beta050, and we are planning to have a new release 14.2.2 with all this fix. Again, thanks for your demo code which is really helpful.

Thanks,
Ben

Hi,

Yes, it seems to be ok with 14.3.0-beta050.

Is there any estimation when release 14.2.2 would be available ? What do you mean with “with all this fix” so will it also include fix for that GetTokenAsync() throwing exception we discussed earlier ?

Br, Simo

-Simo

That’s right. The fix in this post will also be included. HttpRequestException is thrown without network connection - ThinkGeo UI for Desktop / WPF - ThinkGeo Discussion Forums

Hi,

Ok, thanks. Any estimation for that release ?

Br, Simo

Hi Simo, we’re aiming for the first week of February.

Hi,

Any updates for this new release 14.2.2 ?

Br, Simo

Hi Simon, they were out here: NuGet Gallery | ThinkGeo.Core 14.2.2

I upgraded the HowDoI app to v14.3-beta083 and I still see this memory leak running the “Update the GPS Location” WPF sample. I did remove the .net8 target and only compiled for x64 using .Net Framework 4.8. I attached a screen shot of TaskMgr after only running for about 5 minutes.

Hi Rick,

You are right, there was a memory leak in the recent version in some cases when keep refreshing the map. This issue has been fixed in beta085, please pull the latest and have another try.

Thanks,
Ben

@Rick_Heinz2, please let us know if that works for you, if yes we will go ahead and build a hotfix revision.

I have verified that the memory leak associated with the “Update the GPS Location” WPF sample has been fixed in 14.3.0-beta090

Hi Rick,

We’ve just released hotfix 14.2.5 containing this fix, thanks for bringing this issue to our attention!

Thanks,
Ben