for(int i = 0 ; i < numOfTraces ; i++){ TraceClass *trace = new TraceClass(); qDebug() << trace; printf("ii=%d,size =%d\n",i,sizeof(TraceClass)); trace->readTraceHead(fmp); delete trace; trace = NULL; fmp += 240 + 4L * samples; progress->setValue(i+1); qApp->processEvents(QEventLoop::ExcludeUserInputEvents); if(progress->wasCanceled()){ inLineHashMap.clear(); xLineHashMap.clear(); return false; } }voidTraceClass::readTraceHead(uchar*fmp){char*s;longtemplong;shorttempshort;memcpy(&templong,fmp,4);fmp+=4;s=(char*)&templong;TraceHead.TRACENUMBERLINE=BinToLong(s);//001-004
}(1)如果把fmp +=240 + 4L * samples;注釋掉,運(yùn)行程序,內(nèi)存不會(huì)變化很大;(2)如果把memcpy這句話(huà)注釋掉,內(nèi)存不會(huì)飆升,如果不注釋掉,內(nèi)存上升很快達(dá)到G。 請(qǐng)了解的大神指教
- 1 回答
- 0 關(guān)注
- 1075 瀏覽
添加回答
舉報(bào)
0/150
提交
取消