i am checking my program by console window for memory leaks. I encounter the following problems :
When i open my app from ABB menu, and i close it, memory regains ok, but if i open my app a second time and close it, memory don’t regain. it looks like the dispose is not run, because i have added a console.writeline to it, is is displayed the first time, not the second one
Anybody an idea?
2.when i look at the memory in console window, it is decreasing even when i never started my app, with 4096 every 10-20 seconds or so. rapid is not running at this moment, robot is in manual and motors not on.
is this normal beheaviour?
In which classes are you writting this line: UI Controls or other classes? The UI controls are disposed after pressing the Close button; all other classes either the disposed is called manually or let the garbage collector (GC) handles this. The GC is called randomly so it is hard to measure this.
Do you have a connection to the controller in the UI?
I was referring to your TpsView application, if inside your application there are connections and subscriptions to the IRC5?
Even though, I re-read your problem description and you are saying that the memory is decreasing even though no Tps Application is opened. This is not the normal behavior, but we need to monitor if the memory will be released after a while (this means, whenever the GC decides that is time to go and release memory).
// ToDo: Add any constructor code after InitializeComponent call
//
}
///
/// This is where you clean up any remaining resources used by your application before
/// the application itself is disposed of by TAF (TeachPendant Application Framework).
/// The method is called by TAF when the application is closed down.
///
protected override void Dispose(bool disposing)
{
if (!IsDisposed)
{
//try
//{
if (disposing)
{
//ToDo: Call the Dispose method of all FP SDK instances that may otherwise cause memory leak
…
in here i write all the dispose commands.
As i said, it is working the first time when i close my app, but if i reopen my app and close it again, it won’t release the memory