Memory management question -> Form.Close()

B

Burak

Hello,

In one of my winforms pages, I launch another form as follows

Private Sub btnExtract_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnExtract.Click

Dim page As New ShowCourses
page.Show()

End Sub

When this form comes up, I fill a datagrid and then set the dataset
and datadapter to nothing.

After the user looks at the datagrid, they can close this page as
follows:

Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnBack.Click
Me.Close()
End Sub

I observed the Memory Usage for this app from the Processes tab in
the Windows Task Manager and it looked lke the memory usage stayed the
same even though this form was closed.

How do we close a form and release the memory it uses back to the
system?

Thank you,

Burak
 
P

Patrick Steele [MVP]

I observed the Memory Usage for this app from the Processes tab in
the Windows Task Manager and it looked lke the memory usage stayed the
same even though this form was closed.

If no other processes on the machine are requesting memory from the
system, why go through the process of freeing the memory?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top