Effect in .NET Framework can lead to a memory increase on the Service Engine System

Effect in .NET Framework can lead to a memory increase on the Service Engine System

Service Engine AddIns of type Project Wizard Extension are not affected.

Due to an effect in the .Net Framework, it is possible that a memory increase can occur on the Runtime / Service Engine system for AddIns of type Project Service Extension (technical details in [1]).
This has been monitored when copies of a collection are created via the API (e.g. by calling the method GetAlarmEntryCollection) frequently and multiple times.  

This effect can be avoided by changing the loading behavior of the AddIns.
The entry in zenon6.ini must be set as follows:

  1. [ADDINS]
  2. LOAD_ADDINS_IN_DEFAULT_APPDOMAIN
  3. 0 (default)      AddIns are loaded into private AppDomains
  4. 1                     AddIns are loaded into default AppDomain all together

However, setting this entry to 1 means that the AddIns can no longer be reloaded.

____
[1]:
In the given example requesting the AlarmEntryCollection over the API leads to a copy of this collection, whus lifetime is then handled by COM. 
The implementation of this topic merely creates an Adapter object around a newly created set of (COM-Interop) alarm items. The lifetime of this adapter should be managed by the lifetime of the object in the Addin. The freeing process of the underlying COM-interop is however subject of the .Net Framework.
This issue is caused by a bug in the .Net Framework which results in leaks for cross-domain marshalling.
After an Addin has been unloaded, the Garbage Collector is triggered by the AddinFramework.

The ini-switch has been implemented for the following versions and above:
Version 15: build 211377

Version 14: build 211258
Version 12: build 211810
Version 11: build 211818
Version 10: build 211826
Version 8.20: build 210941
Version 8.10: build 204513
Version 8.00: build 204055

When debugging (in disregard of the ini-switch) extensions are always loaded in their own AppDomain.