Skip to content

Commit

Permalink
mythfilldatabase: reduce memory usage.
Browse files Browse the repository at this point in the history
Mythfilldatabase uses QDomDocument to parse and store the XML data that is read; according to QDomDocument documentation this object is not meant to handle large XML files; QXmlStreamReader should be used in these situations.

This commit replaces QDomDocument by QXmlStreamreader.

A test showed that memory usage dropped from 5.6 GB to 698 MB.

Fixes #13517

Signed-off-by: Peter Bennett <pbennett@mythtv.org>
(cherry picked from commit a9aa006)
  • Loading branch information
Hans Dingemans authored and bennettpeter committed May 1, 2020
1 parent 723d46e commit f5d75a6
Show file tree
Hide file tree
Showing 3 changed files with 496 additions and 506 deletions.
1 change: 0 additions & 1 deletion mythtv/programs/mythfilldatabase/filldata.cpp
Expand Up @@ -92,7 +92,6 @@ bool FillData::GrabDataFromFile(int id, QString &filename)
ChannelInfoList chanlist;
QMap<QString, QList<ProgInfo> > proglist;

m_xmltvParser.lateInit();
if (!m_xmltvParser.parseFile(filename, &chanlist, &proglist))
return false;

Expand Down

0 comments on commit f5d75a6

Please sign in to comment.