内存泄漏问题

时间:2011-06-26 15:20:01

标签: .net c++ visual-c++ memory-leaks

我使用_CRTDBG_MAP_ALLOC并将_CrtDumpMemoryLeaks()放在程序出口以检测内存泄漏,并获得以下内存泄漏报告:

Detected memory leaks!
Dumping objects ->
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(188) : {178432} normal block at 0x00FE6BC8, 2150 bytes long.
 Data: < x * > E4 B8 B3 78 CD 02 00 00 2A 04 00 00 01 00 00 00 
{178227} normal block at 0x00FE6050, 12 bytes long.
 Data: < ` ` v > 08 60 FE 00 08 60 FE 00 E0 76 A7 01 
{178226} normal block at 0x00FE6008, 12 bytes long.
 Data: <P` P` > 50 60 FE 00 50 60 FE 00 CD CD CD CD 
{178225} normal block at 0x00FE5FC0, 8 bytes long.
 Data: <p_ > 70 5F FE 00 98 F4 13 00 
{178224} normal block at 0x00FE5F68, 24 bytes long.
 Data: < $ 8^ _ ` > 00 24 FE 00 38 5E FE 00 C0 5F FE 00 08 60 FE 00 
{178223} normal block at 0x00FE5F20, 12 bytes long.
 Data: < ^ ^ > D8 5E FE 00 D8 5E FE 00 C0 82 A7 01 
{178222} normal block at 0x00FE5ED8, 12 bytes long.
 Data: < _ _ > 20 5F FE 00 20 5F FE 00 CD CD CD CD 
{178221} normal block at 0x00FE5E90, 8 bytes long.
 Data: <@^ > 40 5E FE 00 00 00 00 00 
{178220} normal block at 0x00FE5E38, 24 bytes long.
 Data: <h_ ] ^ ^ > 68 5F FE 00 08 5D FE 00 90 5E FE 00 D8 5E FE 00 
{176947} normal block at 0x00FE5DF0, 12 bytes long.
 Data: < ] ] x > A8 5D FE 00 A8 5D FE 00 78 82 A7 01 
{176946} normal block at 0x00FE5DA8, 12 bytes long.
 Data: < ] ] > F0 5D FE 00 F0 5D FE 00 CD CD CD CD 
{176945} normal block at 0x00FE5D60, 8 bytes long.
 Data: < ] > 10 5D FE 00 00 00 00 00 
{176944} normal block at 0x00FE5D08, 24 bytes long.
 Data: <8^ [ `] ] > 38 5E FE 00 D8 5B FE 00 60 5D FE 00 A8 5D FE 00 
{174511} normal block at 0x00FE5CC0, 12 bytes long.
 Data: <x\ x\ @ > 78 5C FE 00 78 5C FE 00 40 98 A7 01 
{174510} normal block at 0x00FE5C78, 12 bytes long.
 Data: < \ \ > C0 5C FE 00 C0 5C FE 00 CD CD CD CD 
{174509} normal block at 0x00FE5C30, 8 bytes long.
 Data: < [ > E0 5B FE 00 00 00 00 00 
{174508} normal block at 0x00FE5BD8, 24 bytes long.
 Data: < ] Z 0\ x\ > 08 5D FE 00 A8 5A FE 00 30 5C FE 00 78 5C FE 00 
{171891} normal block at 0x00FE5B90, 12 bytes long.
 Data: <H[ H[ @n > 48 5B FE 00 48 5B FE 00 40 6E A7 01 
{171890} normal block at 0x00FE5B48, 12 bytes long.
 Data: < [ [ > 90 5B FE 00 90 5B FE 00 CD CD CD CD 
{171889} normal block at 0x00FE5B00, 8 bytes long.
 Data: < Z > B0 5A FE 00 00 00 00 00 
{171888} normal block at 0x00FE5AA8, 24 bytes long.
 Data: < [ xY [ H[ > D8 5B FE 00 78 59 FE 00 00 5B FE 00 48 5B FE 00 
{166775} normal block at 0x00FE5A60, 12 bytes long.
 Data: < Z Z > 18 5A FE 00 18 5A FE 00 D0 A3 A7 01 
{166774} normal block at 0x00FE5A18, 12 bytes long.
 Data: <`Z `Z > 60 5A FE 00 60 5A FE 00 CD CD CD CD 
{166773} normal block at 0x00FE59D0, 8 bytes long.
 Data: < Y > 80 59 FE 00 00 00 00 00 
{166772} normal block at 0x00FE5978, 24 bytes long.
 Data: < Z HX Y Z > A8 5A FE 00 48 58 FE 00 D0 59 FE 00 18 5A FE 00 
{161217} normal block at 0x00FE5930, 12 bytes long.
 Data: < X X h > E8 58 FE 00 E8 58 FE 00 68 86 A7 01 
{161216} normal block at 0x00FE58E8, 12 bytes long.
 Data: <0Y 0Y > 30 59 FE 00 30 59 FE 00 CD CD CD CD 
{161215} normal block at 0x00FE58A0, 8 bytes long.
 Data: <PX > 50 58 FE 00 00 00 00 00 
{161214} normal block at 0x00FE5848, 24 bytes long.
 Data: <xY W X X > 78 59 FE 00 18 57 FE 00 A0 58 FE 00 E8 58 FE 00 
{153281} normal block at 0x00FE5800, 12 bytes long.
 Data: < W W > B8 57 FE 00 B8 57 FE 00 00 A5 A7 01 
{153280} normal block at 0x00FE57B8, 12 bytes long.
 Data: < X X > 00 58 FE 00 00 58 FE 00 CD CD CD CD 
{153279} normal block at 0x00FE5770, 8 bytes long.
 Data: < W > 20 57 FE 00 00 00 00 00 
{153278} normal block at 0x00FE5718, 24 bytes long.
 Data: <HX U pW W > 48 58 FE 00 E8 55 FE 00 70 57 FE 00 B8 57 FE 00 
{145248} normal block at 0x00FE56D0, 12 bytes long.
 Data: < V V @o > 88 56 FE 00 88 56 FE 00 40 6F A9 01 
{145247} normal block at 0x00FE5688, 12 bytes long.
 Data: < V V > D0 56 FE 00 D0 56 FE 00 CD CD CD CD 
{145246} normal block at 0x00FE5640, 8 bytes long.
 Data: < U > F0 55 FE 00 00 00 00 00 
{145245} normal block at 0x00FE55E8, 24 bytes long.
 Data: < W T @V V > 18 57 FE 00 B8 54 FE 00 40 56 FE 00 88 56 FE 00 
{138595} normal block at 0x00FE55A0, 12 bytes long.
 Data: <XU XU > 58 55 FE 00 58 55 FE 00 C0 BA A7 01 
{138594} normal block at 0x00FE5558, 12 bytes long.
 Data: < U U > A0 55 FE 00 A0 55 FE 00 CD CD CD CD 
{138593} normal block at 0x00FE5510, 8 bytes long.
 Data: < T > C0 54 FE 00 00 00 00 00 
{138592} normal block at 0x00FE54B8, 24 bytes long.
 Data: < U S U XU > E8 55 FE 00 88 53 FE 00 10 55 FE 00 58 55 FE 00 
{126958} normal block at 0x00FE5470, 12 bytes long.
 Data: <(T (T x > 28 54 FE 00 28 54 FE 00 78 90 A7 01 
{126957} normal block at 0x00FE5428, 12 bytes long.
 Data: <pT pT > 70 54 FE 00 70 54 FE 00 CD CD CD CD 
{126956} normal block at 0x00FE53E0, 8 bytes long.
 Data: < S > 90 53 FE 00 00 00 00 00 
{126955} normal block at 0x00FE5388, 24 bytes long.
 Data: < T XR S (T > B8 54 FE 00 58 52 FE 00 E0 53 FE 00 28 54 FE 00 
{115884} normal block at 0x00FE5340, 12 bytes long.
 Data: < R R > F8 52 FE 00 F8 52 FE 00 00 9D A7 01 
{115883} normal block at 0x00FE52F8, 12 bytes long.
 Data: <@S @S > 40 53 FE 00 40 53 FE 00 CD CD CD CD 
{115882} normal block at 0x00FE52B0, 8 bytes long.
 Data: <`R > 60 52 FE 00 00 00 00 00 
{115881} normal block at 0x00FE5258, 24 bytes long.
 Data: < S (Q R R > 88 53 FE 00 28 51 FE 00 B0 52 FE 00 F8 52 FE 00 
{103197} normal block at 0x00FE5210, 12 bytes long.
 Data: < Q Q ` > C8 51 FE 00 C8 51 FE 00 60 AD A7 01 
{103196} normal block at 0x00FE51C8, 12 bytes long.
 Data: < R R > 10 52 FE 00 10 52 FE 00 CD CD CD CD 
{103195} normal block at 0x00FE5180, 8 bytes long.
 Data: <0Q > 30 51 FE 00 00 00 00 00 
{103194} normal block at 0x00FE5128, 24 bytes long.
 Data: <XR O Q Q > 58 52 FE 00 F8 4F FE 00 80 51 FE 00 C8 51 FE 00 
{90079} normal block at 0x00FE50E0, 12 bytes long.
 Data: < P P > 98 50 FE 00 98 50 FE 00 90 A8 A7 01 
{90078} normal block at 0x00FE5098, 12 bytes long.
 Data: < P P > E0 50 FE 00 E0 50 FE 00 CD CD CD CD 
{90077} normal block at 0x00FE5050, 8 bytes long.
 Data: < P > 00 50 FE 00 00 00 00 00 
{90076} normal block at 0x00FE4FF8, 24 bytes long.
 Data: <(Q a PP P > 28 51 FE 00 C8 61 FE 00 50 50 FE 00 98 50 FE 00 
{79611} normal block at 0x00FE6268, 12 bytes long.
 Data: < b b G > 20 62 FE 00 20 62 FE 00 A8 47 A7 01 
{79610} normal block at 0x00FE6220, 12 bytes long.
 Data: <hb hb > 68 62 FE 00 68 62 FE 00 CD CD CD CD 
{79609} normal block at 0x00FE48E8, 8 bytes long.
 Data: < a > D0 61 FE 00 00 00 00 00 
{79608} normal block at 0x00FE61C8, 24 bytes long.
 Data: < O $ H b > F8 4F FE 00 00 24 FE 00 E8 48 FE 00 20 62 FE 00 
{62335} normal block at 0x00FE2400, 24 bytes long.
 Data: < a h_  > C8 61 FE 00 68 5F FE 00 CD CD CD CD CD CD CD CD 
{62334} normal block at 0x00FE2F68, 8 bytes long.
 Data: < > 84 F4 13 00 A4 F4 13 00 
{62142} normal block at 0x00FE4138, 12 bytes long.
 Data: < ' @ v > F8 27 FE 00 F0 40 FE 00 E0 76 A7 01 
{62141} normal block at 0x00FE40F0, 12 bytes long.
 Data: <8A @ > 38 41 FE 00 A8 40 FE 00 C0 82 A7 01 
{62140} normal block at 0x00FE40A8, 12 bytes long.
 Data: < @ ( x > F0 40 FE 00 88 28 FE 00 78 82 A7 01 
{62139} normal block at 0x00FE2888, 12 bytes long.
 Data: < @ @( @ > A8 40 FE 00 40 28 FE 00 40 98 A7 01 
{62138} normal block at 0x00FE2840, 12 bytes long.
 Data: < ( ' @n > 88 28 FE 00 F8 27 FE 00 40 6E A7 01 
{62137} normal block at 0x00FE27F8, 12 bytes long.
 Data: <@( 8A > 40 28 FE 00 38 41 FE 00 CD CD CD CD 
{62136} normal block at 0x00FE27B0, 8 bytes long.
 Data: < " > B0 22 FE 00 00 00 00 00 
{62135} normal block at 0x00FE22A8, 24 bytes long.
 Data: < X' ' ' > 08 F9 03 00 58 27 FE 00 B0 27 FE 00 F8 27 FE 00 
{61208} normal block at 0x00FE4060, 12 bytes long.
 Data: <X& @ > 58 26 FE 00 18 40 FE 00 D0 A3 A7 01 
{61207} normal block at 0x00FE4018, 12 bytes long.
 Data: <`@ ? h > 60 40 FE 00 D0 3F FE 00 68 86 A7 01 
{61206} normal block at 0x00FE3FD0, 12 bytes long.
 Data: < @ ? > 18 40 FE 00 88 3F FE 00 00 A5 A7 01 
{61205} normal block at 0x00FE3F88, 12 bytes long.
 Data: < ? & @o > D0 3F FE 00 A0 26 FE 00 40 6F A9 01 
{61204} normal block at 0x00FE26A0, 12 bytes long.
 Data: < ? X& > 88 3F FE 00 58 26 FE 00 C0 BA A7 01 
{61203} normal block at 0x00FE2658, 12 bytes long.
 Data: < & `@ > A0 26 FE 00 60 40 FE 00 CD CD CD CD 
{61202} normal block at 0x00FE2610, 8 bytes long.
 Data: <`' > 60 27 FE 00 00 00 00 00 
{61201} normal block at 0x00FE2758, 24 bytes long.
 Data: < " > & X& > A8 22 FE 00 E8 3E FE 00 10 26 FE 00 58 26 FE 00 
{58938} normal block at 0x00FE43E0, 12 bytes long.
 Data: <xB C x > 78 42 FE 00 98 43 FE 00 78 90 A7 01 
{58937} normal block at 0x00FE4398, 12 bytes long.
 Data: < C PC > E0 43 FE 00 50 43 FE 00 00 9D A7 01 
{58936} normal block at 0x00FE4350, 12 bytes long.
 Data: < C C ` > 98 43 FE 00 08 43 FE 00 60 AD A7 01 
{58935} normal block at 0x00FE4308, 12 bytes long.
 Data: <PC B > 50 43 FE 00 C0 42 FE 00 90 A8 A7 01 
{58934} normal block at 0x00FE42C0, 12 bytes long.
 Data: < C xB G > 08 43 FE 00 78 42 FE 00 A8 47 A7 01 
{58933} normal block at 0x00FE4278, 12 bytes long.
 Data: < B C > C0 42 FE 00 E0 43 FE 00 CD CD CD CD 
{58932} normal block at 0x00FE3F40, 8 bytes long.
 Data: < > > F0 3E FE 00 00 00 00 00 
{58931} normal block at 0x00FE3EE8, 24 bytes long.
 Data: <X' @? xB > 58 27 FE 00 08 F9 03 00 40 3F FE 00 78 42 FE 00 
{54356} normal block at 0x00FE3EA0, 12 bytes long.
 Data: < > X> pw > 10 3E FE 00 58 3E FE 00 70 77 A7 01 
{54355} normal block at 0x00FE3E58, 12 bytes long.
 Data: < > > (w > A0 3E FE 00 10 3E FE 00 28 77 A7 01 
{54354} normal block at 0x00FE3E10, 12 bytes long.
 Data: <X> > > 58 3E FE 00 A0 3E FE 00 CD CD CD CD 
{54353} normal block at 0x00FE25C8, 8 bytes long.
 Data: < / > B8 2F FE 00 00 00 00 00 
{54352} normal block at 0x00FE2FB0, 24 bytes long.
 Data: <h . % > > 68 F8 03 00 90 2E FE 00 C8 25 FE 00 10 3E FE 00 
{54341} normal block at 0x00FE3DC8, 12 bytes long.
 Data: < < = v > F0 3C FE 00 80 3D FE 00 E0 76 A7 01 
{54340} normal block at 0x00FE3D80, 12 bytes long.
 Data: < = 8= > C8 3D FE 00 38 3D FE 00 C0 82 A7 01 
{54339} normal block at 0x00FE3D38, 12 bytes long.
 Data: < = < x > 80 3D FE 00 F0 3C FE 00 78 82 A7 01 
{54338} normal block at 0x00FE3CF0, 12 bytes long.
 Data: <8= = > 38 3D FE 00 C8 3D FE 00 CD CD CD CD 
{54337} normal block at 0x00FE2538, 8 bytes long.
 Data: < . > 98 2E FE 00 00 00 00 00 
{54336} normal block at 0x00FE2E90, 24 bytes long.
 Data: < / ! 8% < > B0 2F FE 00 D0 21 FE 00 38 25 FE 00 F0 3C FE 00 
{54279} normal block at 0x00FE3CA8, 12 bytes long.
 Data: < ; `< > D0 3B FE 00 60 3C FE 00 D0 A3 A7 01 
{54278} normal block at 0x00FE3C60, 12 bytes long.
 Data: < < < h > A8 3C FE 00 18 3C FE 00 68 86 A7 01 
{54277} normal block at 0x00FE3C18, 12 bytes long.
 Data: <`< ; > 60 3C FE 00 D0 3B FE 00 00 A5 A7 01 
{54276} normal block at 0x00FE3BD0, 12 bytes long.
 Data: < < < > 18 3C FE 00 A8 3C FE 00 CD CD CD CD 
{54275} normal block at 0x00FE2F20, 8 bytes long.
 Data: < ! > D8 21 FE 00 00 00 00 00 
{54274} normal block at 0x00FE21D0, 24 bytes long.
 Data: < . X: / ; > 90 2E FE 00 58 3A FE 00 20 2F FE 00 D0 3B FE 00 
{54166} normal block at 0x00FE3B88, 12 bytes long.
 Data: < : @; x > B0 3A FE 00 40 3B FE 00 78 90 A7 01 
{54165} normal block at 0x00FE3B40, 12 bytes long.
 Data: < ; : > 88 3B FE 00 F8 3A FE 00 00 9D A7 01 
{54164} normal block at 0x00FE3AF8, 12 bytes long.
 Data: <@; : ` > 40 3B FE 00 B0 3A FE 00 60 AD A7 01 
{54163} normal block at 0x00FE3AB0, 12 bytes long.
 Data: < : ; > F8 3A FE 00 88 3B FE 00 CD CD CD CD 
{54162} normal block at 0x00FE2260, 8 bytes long.
 Data: <`: > 60 3A FE 00 00 00 00 00 
{54161} normal block at 0x00FE3A58, 24 bytes long.
 Data: < ! h `" : > D0 21 FE 00 68 F8 03 00 60 22 FE 00 B0 3A FE 00 
{53205} normal block at 0x00FE23B8, 12 bytes long.
 Data: <8 @n > 38 F7 03 00 A8 FA 03 00 40 6E A7 01 
{53051} normal block at 0x0003FAA8, 12 bytes long.
 Data: < #  > B8 23 FE 00 88 20 FE 00 C0 BA A7 01 
{52897} normal block at 0x00FE2088, 12 bytes long.
 Data: < 8 G > A8 FA 03 00 38 F7 03 00 A8 47 A7 01 
{2104} normal block at 0x00FE2370, 8 bytes long.
 Data: < # > 10 23 FE 00 00 00 00 00 
{2103} normal block at 0x00FE2308, 40 bytes long.
 Data: < p# p l > A8 F9 03 00 A8 F9 03 00 70 23 FE 00 70 00 6C 00 
{1918} normal block at 0x00FE2040, 12 bytes long.
 Data: < 0 > 18 F6 03 00 F8 1F FE 00 30 81 A7 01 
{1878} normal block at 0x00FE1FF8, 12 bytes long.
 Data: <@ ( > 40 20 FE 00 10 D8 03 00 28 BA A7 01 
{1874} normal block at 0x0003D810, 12 bytes long.
 Data: <  O > F8 1F FE 00 C8 D7 03 00 20 4F A7 01 
{1810} normal block at 0x0003D7C8, 12 bytes long.
 Data: <  m > 10 D8 03 00 80 D7 03 00 F0 6D A7 01 
{1782} normal block at 0x0003D780, 12 bytes long.
 Data: < h 8 > C8 D7 03 00 68 D2 03 00 38 AF A7 01 
{1780} normal block at 0x0003D268, 12 bytes long.
 Data: <  ` > 80 D7 03 00 90 FB 03 00 10 60 A7 01 
{1778} normal block at 0x0003FB90, 12 bytes long.
 Data: <h  > 68 D2 03 00 18 F6 03 00 D8 B9 A7 01 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(188) : {643} normal block at 0x0003D8F0, 62 bytes long.
 Data: < x  > E4 B8 B3 78 10 00 00 00 16 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp(4553) : {592} client block at 0x0003C9C0, subtype c0, 56 bytes long.
a CObject object at $0003C9C0, 56 bytes long
{579} normal block at 0x0003F9A8, 40 bytes long.
 Data: < # #  > 08 23 FE 00 08 23 FE 00 CD CD CD CD CD CD CD CD 
{578} normal block at 0x0003F960, 8 bytes long.
 Data: <x > 78 FE 13 00 00 00 00 00 
{577} normal block at 0x0003F908, 24 bytes long.
 Data: < > "  > E8 3E FE 00 A8 22 FE 00 CD CD CD CD CD CD CD CD 
{576} normal block at 0x0003F8C0, 8 bytes long.
 Data: <L > 4C FE 13 00 00 00 00 00 
{575} normal block at 0x0003F868, 24 bytes long.
 Data: <X: /  > 58 3A FE 00 B0 2F FE 00 CD CD CD CD CD CD CD CD 
{574} normal block at 0x0003F820, 8 bytes long.
 Data: << > 3C FE 13 00 00 00 00 00 
{573} normal block at 0x0003F7C8, 24 bytes long.
 Data: <  > C8 F7 03 00 C8 F7 03 00 CD CD CD CD CD CD CD CD 
{572} normal block at 0x0003F780, 8 bytes long.
 Data: <, > 2C FE 13 00 00 00 00 00 
{571} normal block at 0x0003F738, 12 bytes long.
 Data: < # > 88 20 FE 00 B8 23 FE 00 CD CD CD CD 
{570} normal block at 0x0003F6F0, 8 bytes long.
 Data: < > 1C FE 13 00 00 00 00 00 
{569} normal block at 0x0003F6A8, 12 bytes long.
 Data: <  > A8 F6 03 00 A8 F6 03 00 CD CD CD CD 
{568} normal block at 0x0003F660, 8 bytes long.
 Data: < > 0C FE 13 00 00 00 00 00 
{567} normal block at 0x0003F618, 12 bytes long.
 Data: < @ > 90 FB 03 00 40 20 FE 00 CD CD CD CD 
{566} normal block at 0x0003F5D0, 8 bytes long.
 Data: < > F8 FD 13 00 00 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\oleinit.cpp(84) : {563} client block at 0x0003F4C0, subtype c0, 68 bytes long.
a CCmdTarget object at $0003F4C0, 68 bytes long
{439} client block at 0x00038F80, subtype c0, 64 bytes long.
a CDynLinkLibrary object at $00038F80, 64 bytes long
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {433} normal block at 0x00038D60, 28 bytes long.
 Data: < x  > E4 B8 B3 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {432} normal block at 0x00038D08, 28 bytes long.
 Data: < x  > E4 B8 B3 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {431} normal block at 0x00038C98, 52 bytes long.
 Data: < x  > E4 B8 B3 78 11 00 00 00 11 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {430} normal block at 0x00037D48, 40 bytes long.
 Data: < x  > E4 B8 B3 78 0B 00 00 00 0B 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {429} normal block at 0x00037CE8, 32 bytes long.
 Data: < x  > E4 B8 B3 78 07 00 00 00 07 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {428} normal block at 0x00037C90, 28 bytes long.
 Data: < x  > E4 B8 B3 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {427} normal block at 0x00037C20, 46 bytes long.
 Data: < x  > E4 B8 B3 78 0E 00 00 00 0E 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {426} normal block at 0x00037BB0, 48 bytes long.
 Data: < x  > E4 B8 B3 78 0F 00 00 00 0F 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {424} normal block at 0x000387F0, 42 bytes long.
 Data: < x  > E4 B8 B3 78 0C 00 00 00 0C 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {423} normal block at 0x00038798, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {422} normal block at 0x00038740, 28 bytes long.
 Data: < x  > E4 B8 B3 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {421} normal block at 0x000386D0, 50 bytes long.
 Data: < x  > E4 B8 B3 78 10 00 00 00 10 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {420} normal block at 0x00038678, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {419} normal block at 0x00038620, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {418} normal block at 0x000385C8, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {417} normal block at 0x00038570, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {416} normal block at 0x00038518, 24 bytes long.
 Data: < x  > E4 B8 B3 78 03 00 00 00 03 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {415} normal block at 0x000384C0, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {414} normal block at 0x00038468, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {413} normal block at 0x00038400, 40 bytes long.
 Data: < x  > E4 B8 B3 78 0B 00 00 00 0B 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {412} normal block at 0x000383A8, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {411} normal block at 0x00038340, 44 bytes long.
 Data: < x  > E4 B8 B3 78 0D 00 00 00 0D 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {410} normal block at 0x000382D8, 38 bytes long.
 Data: < x  > E4 B8 B3 78 0A 00 00 00 0A 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {409} normal block at 0x00038280, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {408} normal block at 0x00038228, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {407} normal block at 0x000381C0, 38 bytes long.
 Data: < x  > E4 B8 B3 78 0A 00 00 00 0A 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {406} normal block at 0x00038168, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {405} normal block at 0x00038110, 24 bytes long.
 Data: < x  > E4 B8 B3 78 03 00 00 00 03 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {404} normal block at 0x000380B8, 24 bytes long.
 Data: < x  > E4 B8 B3 78 03 00 00 00 03 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {403} normal block at 0x00038058, 36 bytes long.
 Data: < x  > E4 B8 B3 78 09 00 00 00 09 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {402} normal block at 0x00038000, 24 bytes long.
 Data: < x  > E4 B8 B3 78 03 00 00 00 03 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {401} normal block at 0x00037FA8, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {400} normal block at 0x00037F50, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {399} normal block at 0x00037EF8, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {398} normal block at 0x00037EA0, 24 bytes long.
 Data: < x  > E4 B8 B3 78 03 00 00 00 03 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {397} normal block at 0x00037E48, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {396} normal block at 0x00037DF0, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {395} normal block at 0x00036D58, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {394} normal block at 0x00036D00, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {393} normal block at 0x00036CA8, 28 bytes long.
 Data: < x  > E4 B8 B3 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {391} normal block at 0x00037B38, 60 bytes long.
 Data: < x  > E4 B8 B3 78 15 00 00 00 15 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {390} normal block at 0x00037AC8, 46 bytes long.
 Data: < x  > E4 B8 B3 78 0E 00 00 00 0E 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {389} normal block at 0x00037A60, 42 bytes long.
 Data: < x  > E4 B8 B3 78 0C 00 00 00 0C 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {388} normal block at 0x00037A08, 28 bytes long.
 Data: < x  > E4 B8 B3 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {387} normal block at 0x000379A8, 32 bytes long.
 Data: < x  > E4 B8 B3 78 07 00 00 00 07 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {386} normal block at 0x00037940, 44 bytes long.
 Data: < x  > E4 B8 B3 78 0D 00 00 00 0D 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {385} normal block at 0x000378D0, 50 bytes long.
 Data: < x  > E4 B8 B3 78 10 00 00 00 10 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {384} normal block at 0x00037858, 60 bytes long.
 Data: < x  > E4 B8 B3 78 15 00 00 00 15 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {383} normal block at 0x000371A0, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {382} normal block at 0x00037130, 48 bytes long.
 Data: < x  > E4 B8 B3 78 0F 00 00 00 0F 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {381} normal block at 0x000370D8, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {72} normal block at 0x00036FE0, 32 bytes long.
 Data: < x  > E4 B8 B3 78 07 00 00 00 07 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {71} normal block at 0x00036F88, 28 bytes long.
 Data: < x  > E4 B8 B3 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {70} normal block at 0x00036F20, 44 bytes long.
 Data: < x  > E4 B8 B3 78 0D 00 00 00 0D 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {69} normal block at 0x00036EC0, 34 bytes long.
 Data: < x  > E4 B8 B3 78 08 00 00 00 08 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {68} normal block at 0x00036E60, 30 bytes long.
 Data: < x  > E4 B8 B3 78 06 00 00 00 06 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {67} normal block at 0x000347C0, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {66} normal block at 0x00036DE8, 56 bytes long.
 Data: < x  > E4 B8 B3 78 13 00 00 00 13 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {65} normal block at 0x00034768, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {63} normal block at 0x00036C38, 48 bytes long.
 Data: < x  > E4 B8 B3 78 0F 00 00 00 0F 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {62} normal block at 0x00036BE0, 28 bytes long.
 Data: < x  > E4 B8 B3 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {61} normal block at 0x00036B88, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {60} normal block at 0x00036B10, 54 bytes long.
 Data: < x  > E4 B8 B3 78 12 00 00 00 12 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {59} normal block at 0x00036AB0, 34 bytes long.
 Data: < x  > E4 B8 B3 78 08 00 00 00 08 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {58} normal block at 0x00036A58, 22 bytes long.
 Data: < x  > E4 B8 B3 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {57} normal block at 0x000369F8, 36 bytes long.
 Data: < x  > E4 B8 B3 78 09 00 00 00 09 00 00 00 01 00 00 00 
Object dump complete.

我怀疑我的程序有内存泄漏的原因是我正在为我的算法构建一个原型。该算法包括在xml节点之间进行密集计算,并使用list在for和while循环中添加和删除IXMLDOMNode元素。该算法非常线性,假设我有288个元素。最初,每个元素本身就是一个只包含一个元素的列表,因此原始列表包含288个子列表。当任意两者之间的估计值足够大时,它们将合并并放入新列表中,并从原始列表中删除,直到该值足够小或原始列表为空。

问题是当我运行程序时,它挂起,如果我减小了数据的大小(减去xml节点),它将成功但需要大量内存和很多时间来处理数据。更新到VS2010 sp1之后,问题似乎得到缓解,但是当我运行应用程序时,它会挂起几秒钟,然后恢复正常并显示我预期的结果;但是当它涉及更密集的计算,更多的数据需要处理,应用程序只是挂起,并逐渐消耗内存,就像系统一样吃掉。

我使用sp3在32位win xp上运行VC10,虽然安装了4GB,但PC有3GB RAM可用。

2 个答案:

答案 0 :(得分:2)

不是最后调用_CrtDumpMemoryLeaks,而是将此行添加到程序的开头:

_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);

当手动调用_CrtDumpMemoryLeaks时,它会生成错误的泄漏报告,包括许多尚未发布的静态数据。如果仍有内存泄漏,请确保每个源文件都有DEBUG_NEW重定义,以查看分配源文件和行号。

如果您正在使用MFC,请不要调用_CrtDumpMemoryLeaks并且根本不使用_CrtSetDbgFlag - MFC会在退出之前自动调用_CrtDumpMemoryLeaks。

答案 1 :(得分:1)

源代码来自MFC,但可能只是因为你有一个未发布的MFC对象,并且它的一些数据是在MFC代码中创建的,并且由于对象本身不是释放。

我会检查你是否有任何未正确处理的MFC对象。