首页 新闻 赞助 找找看

内存泄露问题求助System.OutOfMemoryException

1
悬赏园豆:50 [待解决问题]

一个winfrom程序,在做一个普通的查询数据操作的时候出现内存泄露。(该操作每天会进行上千次,偶然一次出现错误,求助怎么排查,错误堆栈如下)

 

System.Exception: 引发类型为“System.OutOfMemoryException”的异常。 在 System.Data.Common.StringStorage.SetCapacity(Int32 capacity)
在 System.Data.RecordManager.set_RecordCapacity(Int32 value)
在 System.Data.RecordManager.GrowRecordCapacity()
在 System.Data.RecordManager.NewRecordBase()
在 System.Data.DataTable.NewRecordFromArray(Object[] value)
在 System.Data.DataTable.LoadDataRow(Object[] values, Boolean fAcceptChanges)
在 System.Data.ProviderBase.SchemaMapping.LoadDataRow()
在 System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
在 System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
在 System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
在 HNAS.Public.DataHelper.SqlHelper.ExecuteDataTable(SqlConnection connection, SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters)
在 HNAS.MobilePlatformDA.PushTaskDA.GetPushTask() 位置 D:\管控服务器版本\MobilePlatform_v2.0_最新(整理注释)\MobilePlatformDA\DA\PushTaskDA.cs:行号 401
在 HNAS.MobilePlatformDA.PushTaskDAF.GetPushTask() 位置 D:\管控服务器版本\MobilePlatform_v2.0_最新(整理注释)\MobilePlatformDA\DAF\PushTaskDAF.cs:行号 223 ---> System.OutOfMemoryException: 引发类型为“System.OutOfMemoryException”的异常。
在 System.Data.Common.StringStorage.SetCapacity(Int32 capacity)
在 System.Data.RecordManager.set_RecordCapacity(Int32 value)
在 System.Data.RecordManager.GrowRecordCapacity()
在 System.Data.RecordManager.NewRecordBase()
在 System.Data.DataTable.NewRecordFromArray(Object[] value)
在 System.Data.DataTable.LoadDataRow(Object[] values, Boolean fAcceptChanges)
在 System.Data.ProviderBase.SchemaMapping.LoadDataRow()
在 System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
在 System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
在 System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
在 HNAS.Public.DataHelper.SqlHelper.ExecuteDataTable(SqlConnection connection, SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters)
在 HNAS.MobilePlatformDA.PushTaskDA.GetPushTask() 位置 D:\管控服务器版本\MobilePlatform_v2.0_最新(整理注释)\MobilePlatformDA\DA\PushTaskDA.cs:行号 401
在 HNAS.MobilePlatformDA.PushTaskDAF.GetPushTask() 位置 D:\管控服务器版本\MobilePlatform_v2.0_最新(整理注释)\MobilePlatformDA\DAF\PushTaskDAF.cs:行号 223
--- 内部异常堆栈跟踪的结尾 ---
在 HNAS.MobilePlatformDA.PushTaskDAF.GetPushTask() 位置 D:\管控服务器版本\MobilePlatform_v2.0_最新(整理注释)\MobilePlatformDA\DAF\PushTaskDAF.cs:行号 230
在 HNAS.MobilePlatformBF.PushTaskBF.getTask() 位置 D:\管控服务器版本\MobilePlatform_v2.0_最新(整理注释)\MobilePlatformBF\PushTaskBF.cs:行号 90
在 PushWinFormServer.MainForm.Push() 位置 D:\管控服务器版本\PushWinFormServer\PushWinFormServer\MainForm.cs:行号 201
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()

gulgui的主页 gulgui | 初学一级 | 园豆:54
提问于:2014-04-08 16:02
< >
分享
所有回答(2)
0

你这不是内存泄露,是内存溢出;内存溢出的直接原因就是内存不够用的了,如果你说是因为内存泄露导致内存溢出的话,你发这个异常出来对分析内存泄露的原因起不到任何帮助。

苗 ︶ㄣ | 园豆:289 (菜鸟二级) | 2014-04-08 17:18
0

System.Data.Common.StringStorage.SetCapacity(Int32 capacity)  是不是capacity 值太大了,写日志捕获一些有用的详细信息吧

平常心队长 | 园豆:1113 (小虾三级) | 2014-04-09 15:58
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册