S
Sean Flook
I am using a DataSet to get lookup tables from my database to use in a form
and when I have finished with the form I am clearing and then disposing of
the DataTables from the DataSet. When running the application against a
memory profiler I am finding that there are String Arrays still left with
the information from the DataTables. The Allocation Call Stack is as
follows:
StringStorage.SetCapacity(int)
DataColumn.SetCapacity(int)
RecordManager.set_RecordCapacity(int)
RecordManager.GrowRecordCapacity()
RecordManager.NewRecordBase()
DataTable.NewRecordFromArray(object[])
DataTable.LoadDataRow(object[], bool)
SchemaMapping.LoadDataRow(bool, bool)
DbDataAdapter.FillLoadDataRow(SchemaMapping)
DbDataAdapter.FillFromReader(object, string, IDataReader, int, int,
DataColumn, object)
DbDataAdapter.Fill(DataSet, string, IDataReader, int, int)
DbDataAdapter.FillFromCommand(object, int, int, string, IDbCommand,
CommandBehavior)
DbDataAdapter.Fill(DataSet, int, int, string, IDbCommand, CommandBehavior)
DbDataAdapter.Fill(DataSet, string)
I would have thought that disposing of the DataTable would have disposed of
the string array, but that does not seem to be the case. Is there any way of
doing this, or is it a known memory leak.
Sean
and when I have finished with the form I am clearing and then disposing of
the DataTables from the DataSet. When running the application against a
memory profiler I am finding that there are String Arrays still left with
the information from the DataTables. The Allocation Call Stack is as
follows:
StringStorage.SetCapacity(int)
DataColumn.SetCapacity(int)
RecordManager.set_RecordCapacity(int)
RecordManager.GrowRecordCapacity()
RecordManager.NewRecordBase()
DataTable.NewRecordFromArray(object[])
DataTable.LoadDataRow(object[], bool)
SchemaMapping.LoadDataRow(bool, bool)
DbDataAdapter.FillLoadDataRow(SchemaMapping)
DbDataAdapter.FillFromReader(object, string, IDataReader, int, int,
DataColumn, object)
DbDataAdapter.Fill(DataSet, string, IDataReader, int, int)
DbDataAdapter.FillFromCommand(object, int, int, string, IDbCommand,
CommandBehavior)
DbDataAdapter.Fill(DataSet, int, int, string, IDbCommand, CommandBehavior)
DbDataAdapter.Fill(DataSet, string)
I would have thought that disposing of the DataTable would have disposed of
the string array, but that does not seem to be the case. Is there any way of
doing this, or is it a known memory leak.
Sean