Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataTables and Memory
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
DataTables and Memory
Miscellaneous
Thread ID:
01292450
Message ID:
01292450
Views:
55
Please help me understand memory de-allocation -- when something gets dumped from RAM. On a windows form (c#):

private void load_customer_combobox()
{
DataSet ds...
DataAdapter da...
...
da.Fill(da,"customers"); // FILL RAM WITH RECORDS HERE

.customer_combobox.DataSource = ds.customers; // POINTER TO RECORDS IN RAM
...

return;
}

Now combobox is loaded and lists customers - works great! Here is my question:

The local ds and da variables have gone out of scope and .customer_combobox.DataSource is the remaining pointer to the DataTable... will the memory occupied by DataTable be released when I close the window or is this a memory leak and I have to add extra code to release it?

Second question: Is the DataSet lost in the above code and only the DataTable exists in RAM or will a DataTable keep the DataSet alive?

I'm asking because I don't want to create any memory problems. Thank you in advance for your help.
Reply
Map
View

Click here to load this message in the networking platform