My Oracle Support Banner

Memory Leak Using OracleBulkCopy (Doc ID 1460467.1)

Last updated on MARCH 04, 2022

Applies to:

Oracle Data Provider for .NET - Version to [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.PerformBulkCopy()
  at Oracle.DataAccess.Client.OracleBulkCopy.WriteDataSourceToServer()
  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

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.