xServer.NET and Memory handling

Within this forum we want to offer discussions all around our .NET based Map control including all .Net-language specific questions concerning calls of the xServer-API. Attention: xServer-relevant concepts can be found in further forums such as xRoute or xTour.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2564
Joined: Mon Apr 14, 2014 10:28 am
Contact:

xServer.NET and Memory handling

Post by Bernd Welter »

Hi there,

here's some info about the memory handling of the xServer.NET control. The post is triggered by a support issue which was labelled as follows:
we use the xServer.NET Control within an OLE Control. When we close the map control a significant amount of memory stays blocked and if we replay the cycle of opening and closing more and more memory is allocated until the available Memory of the 32bit application is reached and the application crashes.
Can you recommend a proper approach which ensures that the memory consumed by the map control is set free once it is no longer required?"
So here's the feedback from PTV Development (translated by myself):
The memory handling of .NET controls is based on the built-in garbage collection of the .NET Framework which means that the creation and destruction of objects are administrated automatically by the framework. Mainly the memory is deallocated whenever a non-deterministic threshold is reached. We assume that the partner's doubts are based on the approaches of frameworks such as C++ or Delphi/Pascal. Within those environments the application itself was responsible for a proper deallocation of memory. We recommend to test the behaviour of the .NET Control by repeated creation/destruction of instances. We expect that the memory will not crash due to the frameworks proper internal maintenance.
Here is also an MemoryPressureTeston Oli's git hub including some more info about the topic.

Feedback is welcome!

Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply