kinotify: Do not store the paths to be added
kinotify used a QQueue<QByteArray> to store all the directories which need to be added. Since we use QDirIterator, each path is presented as a QString which is then encoded to its QByteArray (QFile::encodeName). This results in *large* chunks of memory being allocated, and then slowly being deallocated. Instead, we now use a QDirIterator, and do not store all the directories which need to be added, we simply iterate over them. This way we do not allocate large amounts of memory. There is a large performance improvement as well. On my system, with 38829 directories, adding all the watches now takes only about 10 seconds, instead of about 65. Patch possible due to massif output provided by Jure Repinc <jlp@holodeck1.com>. Thanks a lot. tldr: Use DFS instead of BFS -> Less memory consumption BUG: 304476 REVIEW: 105892 DIGEST: Fix massive memory leak in Nepomuk File Monitoring Service
parent
ea2e960a
Please register or sign in to comment