==9114== HEAP SUMMARY: ==9114== in use at exit: 14,336,980 bytes in 90,048 blocks ==9114== total heap usage: 428,295 allocs, 338,247 frees, 58,358,339 bytes allocated ==9114== ==9114== 0 bytes in 1 blocks are still reachable in loss record 1 of 25,502 ==9114== at 0x4C3289F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==9114== by 0x66F9EBA: QV4::CompiledData::CompilationUnit::linkToEngine(QV4::ExecutionEngine*) (in /opt/Qt5.12.9/5.12.9/gcc_64/lib/libQt5Qml.so.5.12.9) ==9114== by 0x6904054: QQmlObjectCreator::init(QQmlContextData*) (in /opt/Qt5.12.9/5.12.9/gcc_64/lib/libQt5Qml.so.5.12.9) ==9114== by 0x6904202: QQmlObjectCreator::QQmlObjectCreator(QQmlContextData*, QQmlRefPointer<QV4::CompiledData::CompilationUnit> const&, QQmlContextData*, QQmlIncubatorPrivate*) (in /opt/Qt5.12.9/5.12.9/gcc_64/lib/libQt5Qml.so.5.12.9) ==9114== by 0x688E2E1: QQmlComponentPrivate::beginCreate(QQmlContextData*) (in /opt/Qt5.12.9/5.12.9/gcc_64/lib/libQt5Qml.so.5.12.9) ==9114== by 0x688BE48: QQmlComponent::create(QQmlContext*) (in /opt/Qt5.12.9/5.12.9/gcc_64/lib/libQt5Qml.so.5.12.9) ==9114== by 0x4E49D6E: QQuickWidget::continueExecute() (in /opt/Qt5.12.9/5.12.9/gcc_64/lib/libQt5QuickWidgets.so.5.12.9) ==9114== by 0x4E4A18A: QQuickWidgetPrivate::execute() (in /opt/Qt5.12.9/5.12.9/gcc_64/lib/libQt5QuickWidgets.so.5.12.9) ==9114== by 0x1397D2: TWDZVirtualKeyboard::TWDZVirtualKeyboard() (twdzvirtualkeyboard.cpp:24) ==9114== by 0x13965E: TWDZVirtualKeyboard::GetInstance() (twdzvirtualkeyboard.cpp:8) ==9114== by 0x136629: UartTest::UartTest(int, int, QWidget*) (uarttest.cpp:18) ==9114== by 0x136157: communicationModule::initUi() (communicationmodule.cpp:11)
时间: 2024-02-03 20:02:29 浏览: 130
这是 Valgrind 的 HEAP SUMMARY 部分的输出,它显示程序在退出时堆的使用情况。具体来说,它提供了以下信息:
- "in use at exit":退出时在堆上仍然使用的字节数和块数。
- "total heap usage":程序整个运行期间在堆上分配、释放的字节数和块数。
- "0 bytes in 1 blocks are still reachable":这是一个 loss record,表示在程序退出时,有一个块没有被释放,但是指针仍然可以访问到该块。在这个例子中,这个块是由 `operator new[]` 分配的,由 Qt5Qml 库的 `QQmlObjectCreator::init()` 函数链接到引擎中。这并不一定是一个内存泄漏,因为程序结束时操作系统会自动释放所有未释放的内存。但是,如果这些内存块是在一个长时间运行的程序中分配的,可能会导致内存泄漏。
相关问题
==2872== Process terminating with default action of signal 2 (SIGINT) ==2872== at 0x5550D50: nanosleep (nanosleep.c:28) ==2872== by 0x153E2E: void std::this_thread::sleep_for<long, std::ratio<1l, 1000l> >(std::chrono::duration<long, std::ratio<1l, 1000l> > const&) (in /home/zc/ws/RF_Relay_server/src/RF_Relay) ==2872== by 0x1505B0: main (in /home/zc/ws/RF_Relay_server/src/RF_Relay) ==2872== ==2872== HEAP SUMMARY: ==2872== in use at exit: 188,065 bytes in 997 blocks ==2872== total heap usage: 3,008 allocs, 2,011 frees, 402,131 bytes allocated ==2872== ==2872== LEAK SUMMARY: ==2872== definitely lost: 0 bytes in 0 blocks ==2872== indirectly lost: 0 bytes in 0 blocks ==2872== possibly lost: 2,128 bytes in 7 blocks ==2872== still reachable: 185,937 bytes in 990 blocks ==2872== suppressed: 0 bytes in 0 blocks ==2872== Rerun with --leak-check=full to see details of leaked memory ==2872== ==2872== For counts of detected and suppressed errors, rerun with: -v ==2872== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
这个输出是Valgrind的输出结果,其中包含了程序运行时的内存使用情况,包括内存泄漏等问题。具体来说,这个输出中包含了以下几个部分:
1. Process terminating with default action of signal 2 (SIGINT)
这个部分表示程序因为接收到了SIGINT信号而退出。SIGINT信号通常是由于用户发送了中断信号,比如在终端中按下了Ctrl+C。
2. at 0x5550D50: nanosleep (nanosleep.c:28)
这个部分表示程序在退出时正在执行nanosleep函数,位于nanosleep.c文件的第28行。
3. HEAP SUMMARY
这个部分是程序内存使用情况的总结,包括在退出时仍然在使用的内存和已经释放的内存等信息。
4. LEAK SUMMARY
这个部分是程序内存泄漏情况的总结,包括已经泄漏的内存和可能存在的泄漏等信息。其中,definitely lost表示已经确认的内存泄漏,indirectly lost表示间接的内存泄漏,possibly lost表示可能存在的内存泄漏,still reachable表示仍然可以访问但是没有被释放的内存。
5. Rerun with --leak-check=full to see details of leaked memory
这个部分提示你可以使用--leak-check=full选项来查看内存泄漏的详细信息。
需要注意的是,Valgrind的输出信息可能会比较详细,需要耐心查看。另外,在程序中尽可能避免内存泄漏和其他内存错误,可以提高程序的稳定性和性能。
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045021.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)