Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Help with a form not released

Moderators: Vladimir Kondratyev, Anton Katilin

Help with a form not released

Postby ajh » Tue Feb 17, 2009 11:11 pm

I am pulling my hair out trying to figure out why a closed form is still appearing in the memory list.

When I select it, under the 'Merged paths to objects...', the item in the tree says "Objects are roots themselves"

When I select the form and choose "Paths from GC Roots...", I see in the tree :

- NAME OF FORM [Stack Local]
control of System.Windows.Forms.Control/ControlNativeWindow {GC Handle]

Can you help me out with this?

Thanks!
ajh
 
Posts: 1
Joined: Tue May 27, 2008 11:18 pm

Re: Help with a form not released

Postby Vladimir Kondratyev » Wed Feb 18, 2009 10:16 am

It seems that reference to form object is stored in some local variable of method which never finishes.
Vladimir Kondratyev
 
Posts: 1444
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Re: Help with a form not released

Postby Tobbe » Fri Mar 06, 2009 9:07 am

ajh wrote:
When I select the form and choose "Paths from GC Roots...", I see in the tree :

- NAME OF FORM [Stack Local]
control of System.Windows.Forms.Control/ControlNativeWindow {GC Handle]

Can you help me out with this?

Thanks!


We had a simalar problem, cant remember exact what it was, think its a static event that is holding the reference. Or you have implemented a static field of some sort in the form as Vladimir says, Use...
Code: Select all
using(MyForm form = new MyForm())
{
...
...
}


...to ensure correct dispose.

Funny thing, is that we had to use another profiler (demo version) to detect the details what event it was...
Tobbe
 
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am


Return to .NET Profiler

Who is online

Users browsing this forum: No registered users and 2 guests

cron