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;注释掉,运行程序,内存不会变化很大;
(2)如果把memcpy这句话注释掉,内存不会飙升,如果不注释掉,内存上升很快达到G。
请了解的大神指教
相关分类