Memory Leak Using OracleBulkCopy (Doc ID 1460467.1)

Last updated on JANUARY 06, 2014

Applies to:

Oracle Data Provider for .NET - Version 11.2.0.1 to 11.2.0.3 [Release 11.2]
Microsoft Windows (32-bit)

Symptoms

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.PerformBulkCopy()
  at Oracle.DataAccess.Client.OracleBulkCopy.WriteDataSourceToServer()
  at Oracle.DataAccess.Client.OracleBulkCopy.WriteToServer(IDataReader reader)
  ...


Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms