Memory Leak Using OracleBulkCopy
(Doc ID 1460467.1)
Last updated on FEBRUARY 15, 2019
Applies to:Oracle Data Provider for .NET - Version 22.214.171.124 to 126.96.36.199 [Release 11.2]
Microsoft Windows (32-bit)
Setting a batchsize of 1000 or more results in a significant memory leak when using OracleBulkCopy with the Oracle Provider for .NET version 11.2. The memory leak occurs as more data gets inserted. When the batchsize is much higher at 1,000,000, an exception is caught because the program eventually runs out of memory. Many tables are copied and the leak eventually ends up with a callstack as follows when the program runs out of memory:
Oracle.DataAccess.Client.OracleException Memory could not be allocated
at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
at Oracle.DataAccess.Client.OracleBulkCopy.WriteToServer(IDataReader reader)
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document