I'm developing software with VB.NET.
When I open forms and then I close them the virtual memory doesn't released adn this is increasing each time that I open a new form.
I have made a simple software that It opens and close several forms. I close the forms with .close and .dispose but the virtual memory is increasing.
I have open a form and I have close it and I have done a snapshot, then I have open the form and close it again and i have done a snapshot again and I have compared them
The first issue is :
4 types have instances that have been disposed but not GCed.
Investigate the types below for more information.
Open_Close_Forms.Form2, System.Drawing.Graphics, Button, WindowsFont
Why? What I have done bad?
The second issue is:
Undisposed instances (release resource) (Show details) (Ignore...)
One type has instances that have been garbage collected without being properly disposed.
Investigate the type below for more information.
WindowsFont
Why?
And the third issue is:
Pinned instances (Show details) (Ignore...)
2 types have instances that are pinned in memory.
Investigate the types below for more information.
System.Object, System.Object[]
I don't know why and how to fix them. Could you tell me why?
The code
Code: Select all
Form2.Show() (When I open the form)
Me.Close()
Me.Dispose() (When I close the form from the button)