Hi,
I am developing a .Net application reading periodically AF attributes values from a PI AF Server.
I am using the GetValue() method of the AFAttributesList AF SDK object (containing 800 attributes).
When I run the application for some minutes (30 minutes to several hours), there is a clear memory leak in my application related to this instruction (repeated every 5 seconds).
My question is: how I can free the related memory?
Here is my code:
Declaration and initialization at the beginning of the program:
Quote:public AFAttributeList objAFAttributeList = null;
public AFValues objAFValues = null;
Quote:objAFAttributeList = new AFAttributeList();
objAFValues = new AFValues();
block of instruction repeated
Quote: int iLength = 0;
lock (Program.myPIAFDatabase)
{
myPIAFDatabase.Refresh();
}
lock (objManager.objAFAttributeList)
{
objAFValues =objAFAttributeList.GetValue();
iLength = objAFValues.Count;
}
objAFValues.Clear();
objAFValues = null;