I wrote a simple example, run it and monitored memory by windows task manager. Then I remarked this code and view memory usage again, and I don't see any changes. I use Windows 7 + Qt 4.6.2 + MXVC2008. Here is my code.
QByteArray byteArray
= "<?xml version='1.0' encoding='Windows-1251'?>" "<widget>"
"<property name='text'>ТекÑÑ‚</property>"
"</widget>";
for ( int i = 0; i < 1000000; i++ )
{
QXmlQuery xmlQuery;
xmlQuery.bindVariable( "myDocument", &buffer );
xmlQuery.setQuery("string(doc($myDocument)/widget/property[@name='text'])");
bool v = xmlQuery.isValid();
bool eee = xmlQuery.evaluateTo( &sss );
buffer.close();
}
QByteArray byteArray = "<?xml version='1.0' encoding='Windows-1251'?>"
"<widget>"
"<property name='text'>ТекÑÑ‚</property>"
"</widget>";
for ( int i = 0; i < 1000000; i++ )
{
QBuffer buffer( &byteArray );
buffer.open( QIODevice::ReadOnly );
QXmlQuery xmlQuery;
xmlQuery.bindVariable( "myDocument", &buffer );
xmlQuery.setQuery("string(doc($myDocument)/widget/property[@name='text'])");
bool v = xmlQuery.isValid();
QString sss;
bool eee = xmlQuery.evaluateTo( &sss );
buffer.close();
}
To copy to clipboard, switch view to plain text mode
Bookmarks