I have code that works fine in ODP.NET (10.2.0.100) and Oracle 10g server. There is no memory leak. Because I tried to dispose everything every time when I done. The memory stays at 1.2G level while I read/write milliions records.
But the same code gave me momery leak when running in ODP.NET 18.104.22.168. I run my code in Windows 7 (32bit). Based on my watch from task manager, when the machine RAM reaches 2G, I don't see memory increasing any more. But after running for some time with that memory level (2G), it eventually throws out of memory exception.
In the company I work the same problem happened. And since we checked, even in newer versions of ODP.NET the problem continues. To our knowledge this connected to the connection pool.
As a solution had to disable the connection pool. Just insert the connection string token:; Pooling = false;. But is not the ideal solution because the system becomes slower to open connections. If you loop that are opening and closing connections the system will become much slower.
Details on some systems written in C # our error does not occur with the same implementation.
Check also that all objects that are used in the database are being released:
OracleConnection = Dispose
OracleCommand = Dispose
OracleReader = Close and Dispose
If someone can give me a reproducible test case, I can file a bug for you. If the test case is difficult to reproduce, then I recommend opening up a support ticket to diagnose and fix the problem or provide you a fix if one is available.
I experienced the memory leak in 11g ODP.NET 22.214.171.124.
The testbed for testing the memory leak consists of 75 threads and querying 500 rows in each thread.
There were 6 columns of type CLOB in each row of the table.I created a simple console application with the above testbed.
The memory leak were found in the following scenarios mentioned below.
Type ODP.NET Version Oracle Server Finding
DataReader 126.96.36.199 Oracle11g No Error
DataReader 188.8.131.52 Oracle 10g OracleException:Memory could not be allocated
DataSet 184.108.40.206 Oracle 11g System.OutOfMemoryException
DataSet 220.127.116.11 Oracle 10g System.OutOfMemoryException
The stack Trace of SystemOutOfMemoryException is as follows and points to OracleDataReader.
System.String.CtorCharCount(Char c, Int32 count)\r\n at Oracle.DataAccess.Client.OracleDataReader.GetString(Int32 i)\r\n at Oracle.DataAccess.Client.OracleDataReader.GetValue(Int32 i)\r\n at Oracle.DataAccess.Client.OracleDataReader.GetValues(Object values)\r\n at System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object values)\r\n at System.Data.ProviderBase.SchemaMapping.LoadDataRow()\r\n at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)\r\n at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)\r\n at System.Data.Common.DataAdapter.Fill(DataTable dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)\r\n at Oracle.DataAccess.Client.OracleDataAdapter.Fill(DataTable dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)\r\n at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)\r\n at Oracle11gMemLeakAnalysis.DataAdaptor.GetDataTable(String query, OracleConnection DatabaseConnection) in D:\\Oracle11gMemLeakAnalysis\\Oracle11gMemLeakAnalysis\\DataAdaptor.cs:line 40\r\n at Oracle11gMemLeakAnalysis.DataAdaptor.RetriveDataTable(String query, OracleConnection DatabaseConnection) in D:\\Oracle11gMemLeakAnalysis\\Oracle11gMemLeakAnalysis\\DataAdaptor.cs:line 23\r\n at Oracle11gMemLeakAnalysis.Program.GetAllData() in D:\\Oracle11gMemLeakAnalysis\\Oracle11gMemLeakAnalysis\\Program.cs:line 71\r\n at Oracle11gMemLeakAnalysis.Program.LongRunningProcess(Object input) in D:\\Oracle11gMemLeakAnalysis\\Oracle11gMemLeakAnalysis\\Program.cs:line 46"
Can someone help me how to solve this memory leack issue with ODP.NET 18.104.22.168
I didn't find any open bugs specifically involving DataReader or LOBs that were still open for ODP.NET 11.2 in Oracle's Bug DB. That's not to say the bug you have is necessarily new and not fixed yet. The bug may exist and/or be fixed already, but may not be filed under ODP.NET. If a dependent component is causing the problem, such as OCI, then the bug would be filed under those components.
First thing I would recommend is downloading the latest ODP.NET patch for 22.214.171.124 from My Oracle Support and see if the problem reproduces. If so, then open a service request with Oracle Support to have them diagnose, then provide a fix. It's virtually impossible to diagnose the root cause of a memory leak under high load via discussion forum.
This is a folllow-up of the previous mail from 952201
I have carried out the below steps to resolve the ODP.NET 126.96.36.199 MemLeak issue by installing Patach 14543813 on my my Windows 7 32-Bit PC:
1. Uninstalled earlier versions of ODP.NET.
2. Installed ODP.NET 188.8.131.52.
3. Ran my MemLeak Check app. From VS2010. This resulted in MemLeak & the System.OutOfMemoryException(). This was captured in a log file.
4. Installed 14543813 Patch.
5. After installation it was observed that there was a connection issue which was not there before.
6. On Comparing the directories of the earlier dir vs Patch dir, using WinDiff, these were the files that were added extra in the Patch version:
7. Strangely the Oracle.DataAccess.dll remains the same before & after the Patch install.
The Patch 14543813 was supposed to have fixed the Bug 10084752 (MEMORY LEAK USING ORACLEBULKCOPY). But to check the same the Oracle connection does not seem to work. I have followed all the installation steps correctly. Kindly point me in the right direction to resolve the connection issue.