Sqldataadapter fill datatable вызывает утечку памяти
I have a very strange problem where when I Fetch data from SQL DB through DataAdapter the memory in the application pool increases around 250k-300k. private const string _getSPName = "xxxxxxxx"; private readonly string _connectionString;//This is assigned in the constructor public void populate() { using (SqlConnection sqlCon = new System.Data.SqlClient.SqlConnection(_connectionString)) { sqlCon.Open(); if (sqlCon.State == ConnectionState.Open) { using (SqlCommand sqlCmd = new System.Data.SqlClient.SqlCommand(_getSPName, sqlCon) { CommandType = CommandType.StoredProcedure }) { SqlDataAdapter da = new SqlDataAdapter(); DataTable dt = new DataTable(); da.SelectCommand = sqlCmd; sqlCmd.CommandTimeout = 300; da.Fill(dt); } } } }
Что я уже пробовал:
I tried explicitly disposing the Adapter, DataTable and all the connection objects and also tried explicitely calling Garbage collector. But No Luck.