小编Dav*_*vid的帖子

Oracle.ManagedDataAccess 库中可能存在内存泄漏

我开始编写一个将数据从 oracle 数据库复制到 SQL Server 数据库的程序,并立即遇到了内存问题。我正在使用 Oracle.ManagedDataAccess 库(nuget 安装命令:“install-package Oracle.ManagedDataAccess”)。该库版本为 4.122.1.0

这是我的功能:

    private static void LoadTable(TableToLoad table)
    {
        DataTable loadBuffer = null;
        //assume source is oracle for now.  assume destination is sql server
        using (OracleConnection conn = new OracleConnection(table.SourceConnectionString))
        {
            OracleDataReader reader = OracleCommands.GetDataReader(string.Format("select * from \"{0}\".\"{1}\"", table.SourceSchema, table.SourceTable),conn);
            bool foundData = reader.Read();
            if (loadBuffer == null)
            {
                loadBuffer = InitializeBuffer(reader);
            }

            int recordsAffected;

            while (foundData==true)
            {
                object[] currentRowValues = new object[reader.FieldCount];
                int valueCount = reader.GetValues(currentRowValues);
                loadBuffer.Rows.Add(currentRowValues);
                if (loadBuffer.Rows.Count >= …
Run Code Online (Sandbox Code Playgroud)

.net memory oracle oledb memory-leaks

4
推荐指数
1
解决办法
1291
查看次数

标签 统计

.net ×1

memory ×1

memory-leaks ×1

oledb ×1

oracle ×1