下面的代码-如何分析和查找内存泄漏???----高手请给建议?(只要提出建议都有分)

mygoodday 2002-04-28 01:17:58
The thread 0x55C has exited with code 1 (0x1).
The thread 0x73C has exited with code 1 (0x1).
The thread 0x6D0 has exited with code 3 (0x3).
Detected memory leaks!
Dumping objects ->
strcore.cpp(118) : {3011} normal block at 0x0034D0E0, 6775 bytes long.
Data: < j j 1. > 02 00 00 00 6A 1A 00 00 6A 1A 00 00 0A 31 2E 20
strcore.cpp(118) : {2835} normal block at 0x004240A0, 970 bytes long.
Data: < Re> 02 00 00 00 BD 03 00 00 BD 03 00 00 0D 0A 52 65
strcore.cpp(118) : {2829} normal block at 0x00423740, 16 bytes long.
Data: < DDD > 01 00 00 00 03 00 00 00 03 00 00 00 44 44 44 00
strcore.cpp(118) : {1081} normal block at 0x00423FD0, 24 bytes long.
Data: < 1309> 01 00 00 00 0B 00 00 00 0B 00 00 00 31 33 30 39
strcore.cpp(118) : {1080} normal block at 0x004237D0, 16 bytes long.
Data: < DDD > 01 00 00 00 03 00 00 00 03 00 00 00 44 44 44 00
strcore.cpp(118) : {1072} normal block at 0x00423210, 273 bytes long.
Data: < Send> 02 00 00 00 04 01 00 00 04 01 00 00 53 65 6E 64
afxtempl.h(330) : {104} normal block at 0x00422980, 92 bytes long.
Data: < ,-B > 1C 90 02 10 02 00 00 00 01 00 00 00 2C 2D 42 00
afxtempl.h(330) : {102} normal block at 0x00422A10, 92 bytes long.
Data: < ,-B > 1C 90 02 10 02 00 00 00 01 00 00 00 2C 2D 42 00
strcore.cpp(118) : {100} normal block at 0x00422B00, 62 bytes long.
Data: < 1 1 D:\ > 02 00 00 00 31 00 00 00 31 00 00 00 44 3A 5C CD
strcore.cpp(118) : {93} normal block at 0x00422D20, 24 bytes long.
Data: < 1309> 02 00 00 00 0B 00 00 00 0B 00 00 00 31 33 30 39
strcore.cpp(118) : {64} normal block at 0x004215F0, 22 bytes long.
Data: < LOCA> 01 00 00 00 09 00 00 00 09 00 00 00 4C 4F 43 41
strcore.cpp(118) : {63} normal block at 0x00421640, 24 bytes long.
Data: < 1361> 01 00 00 00 0B 00 00 00 0B 00 00 00 31 33 36 31
Object dump complete.
The thread 0x710 has exited with code 3 (0x3).


上面的代码中:
1:
The thread 0x6D0 has exited with code 3 (0x3).
exited with code 3 是什么意思。为什么有时候是3有时候是0和1呢?
(0x3)代表什么?

2:
Data: < j j 1. > 02 00 00 00 6A 1A 00 00 6A 1A 00 00
这段代码是什么意思。

3:
上面说得Detected memory leaks!在那里可以看出??

请大家各自留一下你的建议,都会有分。
...全文
82 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
MasterGo 2002-04-28
  • 打赏
  • 举报
回复
你是用什么工具查的,我不太知道,告诉我好吗
GZCompiler 2002-04-28
  • 打赏
  • 举报
回复
说说模块类型:
普通模块(normal block) 是由你的程序分配的普通内存。

客户模块(client block) 是一种特殊的内存模块,它由于需要一个析构函数的对象而被Microsoft Foundation Classes (MFC)所使用。MFC new操作子建立一个普通模块或者一个客户模块,来适合被创建的模块。

CTR模块 是由CRT库提供自己使用而分配的内存模块。CRT库对这些模块来管理自己的去分配,因此你不可能在内存泄漏报告中注意到这些,除非有些地方有严重的错误(例如,CRT库崩溃)。
GZCompiler 2002-04-28
  • 打赏
  • 举报
回复
strcore.cpp(118) : {3011} normal block at 0x0034D0E0, 6775 bytes long.
Data: < j j 1. > 02 00 00 00 6A 1A 00 00 6A 1A 00 00 0A 31 2E 20
strcore.cpp表示出现泄漏的文件,(118)表示出现泄漏的行号,
{3011}是内存分配数值,normal block是模块类型,
0x0034D0E0是泄漏内存地址,6775是泄漏的总字节数。
下面的Data是第一个十六字节的内容。
鼠标双击包含文件名的行或选中该行按F4可以定位到指定位置。
tianlinyi 2002-04-28
  • 打赏
  • 举报
回复
up
xuying 2002-04-28
  • 打赏
  • 举报
回复
从这里说明你的代码有内存泄漏:
Detected memory leaks!
Dumping objects ->

但你无法得知是程序中的那一部分。这需要自己手工查看,和其他工具的辅助,如Rational的Purify或者BoundsChecker。
zxs218 2002-04-28
  • 打赏
  • 举报
回复
2:
Data: < j j 1. > 02 00 00 00 6A 1A 00 00 6A 1A 00 00
这段代码是什么意思。

这里是未释放的内存地址,及其内容,用鼠标双击即可获得什么地方的你内存发生泄漏。

我看你上面的代码,好像是很多的CString对象没有被释放。
yu_hl 2002-04-28
  • 打赏
  • 举报
回复
1. 0一般是正常结束。
2。表明有内存泄漏
3. 见2.
:)

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧