[Qt-creator] clangtools cpu load

Cristian Adam cristian.adam at qt.io
Sat Jul 9 16:07:20 CEST 2022

Hi Björn,

Try this patch:

--- src/plugins/clangtools/clangtoolrunner.cpp

+++ src/plugins/clangtools/clangtoolrunner.cpp

@@ -67,6 +67,7 @@ void ClangToolRunner::init(const FilePath &outputDirPath, const Environment &env



+    m_process.setUseCtrlCStub(true);

     m_process.setWorkingDirectory(m_outputDirPath); // Current clang-cl puts log file into working dir.

     connect(&m_process, &QtcProcess::done, this, &ClangToolRunner::onProcessDone);


Should fix your problem.


From: Qt-creator <qt-creator-bounces at qt-project.org> on behalf of Björn Schäpers <qt-maillist at hazardy.de>
Sent: Friday, July 8, 2022 10:21 PM
To: qt-creator <qt-creator at qt-project.org>
Subject: [Qt-creator] clangtools cpu load

Hi there,

I'm witnessing a crippling cpu load from the clangtools plugin through
clang-tidy. I'm using a quite recent LLVM and qt-creator from this morning
(CEST) on Windows.

It seems the clang-tidy.exe analyzes the source files and afterwards starts a
child process llvm-tokenizer.exe, and there is the problem. When the Creator
kills the clang-tidy process, the llvm-tokenizer continues to live and use one
core at 100%.

So these processes accumulate while editing and very soon the whole system is
quite unusable until the llvm-tokenizers are done with their work.

Has anyone experience with that, or a way to handle the problem? As far as I can
see QProcess has no way of terminating the child processes.

Kind regards,
Qt-creator mailing list
Qt-creator at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20220709/c5803d7b/attachment.htm>

More information about the Qt-creator mailing list