Memory leaks in the program
Posted: Fri Jul 14, 2017 10:44 am
When making self tests opening certain program items I saw that the programs always consume more memory - both, the VO-Win32 version and the X#-Dotnet version.
Using the Telerik Justtrace Memory profiler I could find the reasons.
The program allows to take a snapshot of all objects in memory, then a user can perform some actions like opening/closing a program item, and then a second snapshot can be taken.
The Memory profiler makes a comparison of all objects before and after and shows their object names in a list and the dependencies between them.
The culprit:
Objects were holding references on each other so that the Garbage Collector did not understand that all of them could be removed. Calling Destroy methods of one object in the destroy method of the other resolved this.
So in Dotnet are still valid the old VO garbage collector rules: the program should help to destroy objects where possible. What is impressive are the possibilities to analyze behavior of the programs from external.
Arne
Using the Telerik Justtrace Memory profiler I could find the reasons.
The program allows to take a snapshot of all objects in memory, then a user can perform some actions like opening/closing a program item, and then a second snapshot can be taken.
The Memory profiler makes a comparison of all objects before and after and shows their object names in a list and the dependencies between them.
The culprit:
Objects were holding references on each other so that the Garbage Collector did not understand that all of them could be removed. Calling Destroy methods of one object in the destroy method of the other resolved this.
So in Dotnet are still valid the old VO garbage collector rules: the program should help to destroy objects where possible. What is impressive are the possibilities to analyze behavior of the programs from external.
Arne