Topic
2 replies Latest Post - ‏2012-05-22T15:33:22Z by SystemAdmin
SystemAdmin
SystemAdmin
2948 Posts
ACCEPTED ANSWER

Pinned topic How to find a leak source from this memory leak message of Purify

‏2012-05-17T00:47:30Z |
I am using PurifyPlus 7.0.1 to test our Windows Service.

Regarding that it is showing me a big memory Leak of about 2652 bytes. However in the Purify call trace it is not pointing me to any of our code and only pointing to ATL String. But it must be initiating from our code. So is there any way I can find what areas in my code have caused this, from Purify provided info. I am copying purify error details below. I am really stuck in this and I have to resolve this before end of this week. I would really appreciate any help in this regard.

[W] MLK: Memory leak of 2652 bytes from 97 blocks allocated in ATL::CSimpleStringT<char,0>::Fork(int) http://ZeroConfigService.exe
Distribution of leaked blocks
325 bytes from 13 blocks of 25 bytes (first block: 0x04158e48)
260 bytes from 10 blocks of 26 bytes (first block: 0x04278788)
240 bytes from 10 blocks of 24 bytes (first block: 0x04157f60)
230 bytes from 10 blocks of 23 bytes (first block: 0x04157e60)
189 bytes from 7 blocks of 27 bytes (first block: 0x042788a8)
180 bytes from 6 blocks of 30 bytes (first block: 0x04158f20)
175 bytes from 5 blocks of 35 bytes (first block: 0x042786d8)
168 bytes from 6 blocks of 28 bytes (first block: 0x04158f68)
155 bytes from 5 blocks of 31 bytes (first block: 0x04278a10)
154 bytes from 7 blocks of 22 bytes (first block: 0x04157ee0)
145 bytes from 5 blocks of 29 bytes (first block: 0x04158fb0)
128 bytes from 4 blocks of 32 bytes (first block: 0x04278a58)
102 bytes from 3 blocks of 34 bytes (first block: 0x042797c0)
72 bytes from 2 blocks of 36 bytes (first block: 0x04279900)
38 bytes from 1 block of 38 bytes (0x04279a40)
37 bytes from 1 block of 37 bytes (0x04279ae0)
33 bytes from 1 block of 33 bytes (0x04279950)
21 bytes from 1 block of 21 bytes (0x04158120)
Allocation location
CAfxStringMgr::Allocate(int,int) f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp:141
ATL::CSimpleStringT<char,0>::Fork(int) c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlsimpstr.h:809
ATL::CSimpleStringT<char,0>::PrepareWrite2(int) c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlsimpstr.h:849
ATL::CSimpleStringT<char,0>::SetString(char const*,int) c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlsimpstr.h:654
ATL::CStringT<char,StrTraitMFC<char,ChTraitsCRT<char>::ATL>>::CStringT<char,StrTraitMFC<char,ChTraitsCRT<char>::ATL>>(char const*) c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\cstringt.h:966
FontFamalyProcFonts f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxglobals.cpp:163
Thanks,
Umer
Updated on 2012-05-22T15:33:22Z at 2012-05-22T15:33:22Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    2948 Posts
    ACCEPTED ANSWER

    Re: How to find a leak source from this memory leak message of Purify

    ‏2012-05-17T03:04:38Z  in response to SystemAdmin
    Hi Umer,

    For your copied log, the memory leak which Purify determined is system ATL memory leak, not your code problem. System (even OS) has also memory leaks. So you may ignore this, go ahead to test more your services features with PurifyPlus, PurifyPlus can help you to pinpoint memory leaks and other hard-to-find problems if your code has potential issues.

    If you still have PurifyPlus questions, please let us know the details of your PurifyPlus version, your services build configurations, and your settings to run the service in PurifyPlus.

    Regards,
    Gary
    • SystemAdmin
      SystemAdmin
      2948 Posts
      ACCEPTED ANSWER

      Re: How to find a leak source from this memory leak message of Purify

      ‏2012-05-22T15:33:22Z  in response to SystemAdmin
      I constantly see such leak reports, and it isn't really clear if ATL/STL is at fault, or if something in our code contains some issue preventing the release of the memory.
      I also see some ABWL and IPW errors that appear to originate in the ATL/STL area, but am uncertain if these are MS issues or our issues.

      How do these ATL issues get resolved?
      • Are updates to Visual Studio files needed from MS (header files, etc.), along with a rebuild of the app?
      • Are Windows Update patches going to resolve them? (My guess is NO, since I'm up to date.)
      • Does the app being tested need to use newer WinSXS runtime binaries from MS?
      • Are such fixes available anywhere? Or do we just have to live with these leak reports?

      (This was in iFix 001. I've just upgraded to 003.)