本机C++的内存问题在Windows上的应用

发布于 2025-01-20 21:14:27 字数 1176 浏览 3 评论 0原文

我正在研究一个bad_alloc崩溃的多线程本机CPP应用程序,从windbg中,它显然是在分配堆上的大对象时发生的(主要是basic_string ctor或与新操作员分配的一些数组分配)。从!地址-Summary和来自Debugdiag的内存分析似乎很高,但堆的大小仍然很小(约70 MB)。

LFH Key                   : 0x233116ff
Termination on corruption : ENABLED
  Heap     Flags   Reserv  Commit  Virt   Free  List   UCR  Virt  Lock  Fast 
                    (k)     (k)    (k)     (k) length      blocks cont. heap 
-----------------------------------------------------------------------------
05f60000 00000002   68964  56804  68964   8411 37570    13    2  29701      
    External fragmentation  14 % (37570 free blocks)
072a0000 00001002      60      4     60      2     1     1    0      0      
096f0000 00001002      60      4     60      2     1     1    0      0      
1f430000 00001002      60      4     60      2     1     1    0      0      
-----------------------------------------------------------------------------

我想从用法表中深入了解内存,并找出更高的内存分配的原因,有关如何进一步进行的任何建议?

I'm investigating a bad_alloc crashes for a multithreaded native cpp app, from WinDbg it's clearly happening on allocating large object on heap (mostly basic_string ctor or some array allocation with new operator). From the !address -summary and memory analysis from DebugDiag it's seems like app memory usage is very high but heap size is still very small (around 70 MB).

Address Summary

LFH Key                   : 0x233116ff
Termination on corruption : ENABLED
  Heap     Flags   Reserv  Commit  Virt   Free  List   UCR  Virt  Lock  Fast 
                    (k)     (k)    (k)     (k) length      blocks cont. heap 
-----------------------------------------------------------------------------
05f60000 00000002   68964  56804  68964   8411 37570    13    2  29701      
    External fragmentation  14 % (37570 free blocks)
072a0000 00001002      60      4     60      2     1     1    0      0      
096f0000 00001002      60      4     60      2     1     1    0      0      
1f430000 00001002      60      4     60      2     1     1    0      0      
-----------------------------------------------------------------------------

I want to dig deep into the memory from the usage table and find out the cause of higher memory allocation, any suggestion on how to proceed further?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文