YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Issue in freeing AFValue objects - memory leak using AFSDK Options · View
rasta_raf
#1 Posted : Monday, May 23, 2011 6:26:58 PM
Rank: Newbie
Groups: Member

Joined: 10/16/2009
Posts: 6
Location: Tunis
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;


Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.