Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataTables and Memory
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
DataTables and Memory
Divers
Thread ID:
01292450
Message ID:
01292450
Vues:
56
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.
Répondre
Fil
Voir

Click here to load this message in the networking platform