Heob を使ってメモリリークを検出する

Windows では、Heob ヒープオブザーバーを使用して、バッファオーバーランやメモリリークを検出します。

現在開いているプロジェクトで Heob を実行するには:

  1. Analyze 」>「Heob 」を選択します。

    Heobの設定

  2. 使用する Heob 設定プロファイルを選択するか、[New ] を選択して新しいプロファイルを作成します。
  3. Heob path 」に、Heob 実行ファイルのパスを入力します。
  4. チェックを実行するための設定を指定します。
  5. OK 」を選択して Heob を実行します。

Qt Creator アプリケーションが実行され、その後、ターミナルで Heob が実行されます。

ターミナルで実行中のHeob

Heob は、バッファオーバーランが発生するとアクセス違反を発生させ、問題のある命令とバッファ割り当てのスタックトレースを記録します。Heob が正常に終了した後、Memcheck ビューで結果を確認できます。

Memcheck ビューにおける Heob の結果

「手順: 分析」、「アナライザ」、「Heob」、および「コードの分析も参照してください

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.