I have removed includes not connected with Qt (windows.h, map, vector ),
i use only includes started with Q. I use QFile instead of CreateFile etc...
When i enter the code below, and make breakpoint on some line, when it break,
then I hit F10 and program suspends... 100% CPU, +500MB memory used and
growing...
And don't know what is wrong.
Before mentioned function i open the file, allocate 8MB memory on heap for
file data, and close the file ...
any suggestions ?
bool LogFileAnalizer::BuildTransactionVector( QString& error )
{
// clear previous data
_transactions.clear();
// constants used
const Char BeginMark = _pVersion->GetBeginMark();
const Char EmptyMark = _pVersion->GetEmptyMark();
const Char EmptyMemoryId = _pVersion->GetUnusedMemTransactionId();
const Char WrongMemoryId = _pVersion->GetWrongMemoryTransactionId();
const Char RootBeginId = 0x35; //!! hardcoded, change later
const Char RootEndId = 0x38; //!! hardcoded, change later
const Char RootContId = 0x39; //!! hardcoded, change later -> works like RootEndId
const Int MinEmptyDataSize = 128; // minimum continous empty mark size to treat it as empty space (not trans param) !! hardcoded - change later
// data pointers
Char* fileBegin = _data; // file begin
Char* fileEnd = _data + _fileSize; // file end
Char* dataBegin = 0; // transactions data begin - to find
Char* dataEnd = 0; // transactions data end - to find
// cursors
Char* pos = _data; // position to go through buffer
Char* end = _data + _fileSize; // buffer end postion
// FIND EMPTY BUFFER END TRANSACTION ENTRY BEGIN AND END
// go to first transaction
while(( *pos != BeginMark && pos < end ) || (( pos + 1 ) < end && *pos == BeginMark && *( ++pos ) == BeginMark )) // second condition skips double BeginMark which means a normal data
{
++pos;
}
....
bool LogFileAnalizer::BuildTransactionVector( QString& error )
{
// clear previous data
_transactions.clear();
// constants used
const Char BeginMark = _pVersion->GetBeginMark();
const Char EmptyMark = _pVersion->GetEmptyMark();
const Char EmptyMemoryId = _pVersion->GetUnusedMemTransactionId();
const Char WrongMemoryId = _pVersion->GetWrongMemoryTransactionId();
const Char RootBeginId = 0x35; //!! hardcoded, change later
const Char RootEndId = 0x38; //!! hardcoded, change later
const Char RootContId = 0x39; //!! hardcoded, change later -> works like RootEndId
const Int MinEmptyDataSize = 128; // minimum continous empty mark size to treat it as empty space (not trans param) !! hardcoded - change later
// data pointers
Char* fileBegin = _data; // file begin
Char* fileEnd = _data + _fileSize; // file end
Char* dataBegin = 0; // transactions data begin - to find
Char* dataEnd = 0; // transactions data end - to find
// cursors
Char* pos = _data; // position to go through buffer
Char* end = _data + _fileSize; // buffer end postion
// FIND EMPTY BUFFER END TRANSACTION ENTRY BEGIN AND END
// go to first transaction
while(( *pos != BeginMark && pos < end ) || (( pos + 1 ) < end && *pos == BeginMark && *( ++pos ) == BeginMark )) // second condition skips double BeginMark which means a normal data
{
++pos;
}
....
To copy to clipboard, switch view to plain text mode
Bookmarks