vs2010+Qt4.8.5向postgresql(9.6版)数据库一次插入300M数据内存过度增长,直接崩溃

这个是刚启动时的内存

img

这个是执行下面代码后的内存,直接崩溃

img

内存直接涨了1000多M,不清楚为什么

//以下是代码

QSqlQuery query;
// query.setForwardOnly(true);
//读取数据文件
QFile rFile("D:/qt-opensource-windows-x86-msvc2013-5.5.1.exe");
rFile.open(QIODevice::ReadOnly);
bool bFirst = true;//判断是否是第一次读取
int readMaxSize = 10241024300;//一次读取最大字节数
QByteArray tempByte;
QString sqlStr;//sql语句
QString tempStr = "1";
while (!rFile.atEnd())
{
tempByte = rFile.read(readMaxSize);

    if (bFirst)
    {
        sqlStr = "insert into testbigfile(id,data) values(:id,:data)";
    }
    else
    {
        sqlStr = "update set data=data||:data from testbigfile id='1'";
    }

    if(query.prepare(sqlStr))
    {
        if (bFirst)
        {
            query.bindValue(":id",tempStr);
            query.bindValue(":data",tempByte,QSql::Binary);
        }
        else
        {
            query.bindValue(":data",tempByte,QSql::Binary);
        }
        if (!query.exec())
        {
            QString errStr = query.lastError().text();
            QMessageBox::critical(NULL,"错误",errStr);
        }
        query.clear();
    }
    else
    {
        QMessageBox::critical(NULL,"错误","sql执行失败");
    }
}

rFile.close();

int readMaxSize = 10241024300;这句是10241024300共计300M提交的时候*被自动注释掉了