title: Qt QString gets a lot of memory
body: <p>After executing the code below, I see that the line</p>
  
  <pre><code>encoded = QString(DicResourceByteArray.toBase64().data());
  </code></pre>
  
  <p>gets too much RAM. Approximately 60MB.</p>
  
  <p>How can I release it from memory?</p>
  
  <pre><code>Dic_block DicBlock;
  qint64 Count;
  int pos, len;
  QByteArray DicResourceByteArray;
  QDataStream out(&amp;DicResourceByteArray, QIODevice::WriteOnly);
  
  QString encoded;
  while(DicInstance.readBlock(DicBlock))
  {
  
      if(DicBlock.type == 2)
      {
          pos = 0;
          len = (unsigned char)DicBlock.data[pos++];
          std::string filename( DicBlock.data+pos, len );
          pos += len;
  
          out.writeRawData(DicBlock.data + pos, DicBlock.length - pos);
  
          encoded = QString(DicResourceByteArray.toBase64().data());
  
          QString strQuery = QString("INSERT INTO Dictionary_Resources([FileName], [ImageBasedOn64]) values('%1', '%2')").arg(QString::fromStdString(filename), encoded);
  
          query-&gt;exec(strQuery);
  
          delete encoded;
  
  
      }
  }
  delete query;
  db.close();
  
  //...
  
  DicInstance.close();
  </code></pre>