I have a memory problem when running a VB.Net application.
The application uses a from frmMain from which another form can be opened:
Private Sub OpenTheNewForm( )
dim frm as New frmSecondform
frm ShowDialog()
End Sub
At some point in time the second form is closed and the program returns to
the main form frmMain:
Private Sub CloseTheSecondF orm()
Me.Close()
End Sub
When I look at the memory usage during execution of the program (using
Windows' Taskmanager) I see the memory usage increase with several Mb's as
soon as the second form is loaded. That is normal, I guess.
But when I close this form only a few Kb's of memory are released. Loading
the second form again increases the memory usage by several Mb's again. And
so on and so on.
After opening the second form a couple of times, the total memory used by
the program may have increased to as much as 150-200 Mb.
I'm sure that this is not how it is intended to be. But I haven't find a
solution yet. I have tried the Dispose-statement, to no effect.
What am I missing here? How do I release unused memory.
Please note, that I am rather a newbie. Thanks.
The application uses a from frmMain from which another form can be opened:
Private Sub OpenTheNewForm( )
dim frm as New frmSecondform
frm ShowDialog()
End Sub
At some point in time the second form is closed and the program returns to
the main form frmMain:
Private Sub CloseTheSecondF orm()
Me.Close()
End Sub
When I look at the memory usage during execution of the program (using
Windows' Taskmanager) I see the memory usage increase with several Mb's as
soon as the second form is loaded. That is normal, I guess.
But when I close this form only a few Kb's of memory are released. Loading
the second form again increases the memory usage by several Mb's again. And
so on and so on.
After opening the second form a couple of times, the total memory used by
the program may have increased to as much as 150-200 Mb.
I'm sure that this is not how it is intended to be. But I haven't find a
solution yet. I have tried the Dispose-statement, to no effect.
What am I missing here? How do I release unused memory.
Please note, that I am rather a newbie. Thanks.
Comment