Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Detected memory leaks! - How to get the point of memory leak and remove it

Detected memory leaks! - How to get the point of memory leak and remove it

Scheduled Pinned Locked Moved C / C++ / MFC
c++regexperformancetutorial
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JHAKAS
    wrote on last edited by
    #1

    Hi As usual i recd. following message on my build output window How to find the point of the memory leak and how to overcome it. Thanks a lot for any suggestion. Sandeep **Detected memory leaks!** Dumping objects -> strcore.cpp(118) : {1639} normal block at 0x0063B6B0, 181 bytes long. Data: < ODBC> 01 00 00 00 A8 00 00 00 A8 00 00 00 4F 44 42 43 D:\Documents and Settings\erc\Desktop\Pattern\DBManager.cpp(32) : {1633} client block at 0x0063B900, subtype 0, 100 bytes long. a CDatabase object at $0063B900, 100 bytes long D:\Documents and Settings\erc\Desktop\Pattern\PatternDoc.cpp(508) : {1535} client block at 0x0063A180, subtype 0, 88 bytes long. a CObject object at $0063A180, 88 bytes long :) Leave your mark wherever you go

    D G 2 Replies Last reply
    0
    • J JHAKAS

      Hi As usual i recd. following message on my build output window How to find the point of the memory leak and how to overcome it. Thanks a lot for any suggestion. Sandeep **Detected memory leaks!** Dumping objects -> strcore.cpp(118) : {1639} normal block at 0x0063B6B0, 181 bytes long. Data: < ODBC> 01 00 00 00 A8 00 00 00 A8 00 00 00 4F 44 42 43 D:\Documents and Settings\erc\Desktop\Pattern\DBManager.cpp(32) : {1633} client block at 0x0063B900, subtype 0, 100 bytes long. a CDatabase object at $0063B900, 100 bytes long D:\Documents and Settings\erc\Desktop\Pattern\PatternDoc.cpp(508) : {1535} client block at 0x0063A180, subtype 0, 88 bytes long. a CObject object at $0063A180, 88 bytes long :) Leave your mark wherever you go

      D Offline
      D Offline
      Diddy
      wrote on last edited by
      #2

      You usually find the memory leak by simply clicking on the line reported say strcore.cpp(118) But, if that file resides out side your project, as strcore.cpp does (its part of MFC) it wont work. The second leak should "D:\Documents and Settings\erc\Desktop\Pattern\DBManager.cpp(32) " Double click it and it will take you to where it was allocated. As for the first, you have a leak via a CString somewhere.

      G 1 Reply Last reply
      0
      • J JHAKAS

        Hi As usual i recd. following message on my build output window How to find the point of the memory leak and how to overcome it. Thanks a lot for any suggestion. Sandeep **Detected memory leaks!** Dumping objects -> strcore.cpp(118) : {1639} normal block at 0x0063B6B0, 181 bytes long. Data: < ODBC> 01 00 00 00 A8 00 00 00 A8 00 00 00 4F 44 42 43 D:\Documents and Settings\erc\Desktop\Pattern\DBManager.cpp(32) : {1633} client block at 0x0063B900, subtype 0, 100 bytes long. a CDatabase object at $0063B900, 100 bytes long D:\Documents and Settings\erc\Desktop\Pattern\PatternDoc.cpp(508) : {1535} client block at 0x0063A180, subtype 0, 88 bytes long. a CObject object at $0063A180, 88 bytes long :) Leave your mark wherever you go

        G Offline
        G Offline
        GDavy
        wrote on last edited by
        #3

        one way is dubble clicking on the line the other reading it.. first line says: strcore.cpp(118) etc etc etc says that the mem was allocated on line 118 of the strcore.cpp file...(but never deallocated) in your DBManager.cpp file line 32 you allocate memory that wasn^t deallocated same for PatternDoc.cpp line 508. as for in which situations that occurs... Debug!! put breakpoints and read carefull your new and delete statements! Regards, Davy

        J 1 Reply Last reply
        0
        • D Diddy

          You usually find the memory leak by simply clicking on the line reported say strcore.cpp(118) But, if that file resides out side your project, as strcore.cpp does (its part of MFC) it wont work. The second leak should "D:\Documents and Settings\erc\Desktop\Pattern\DBManager.cpp(32) " Double click it and it will take you to where it was allocated. As for the first, you have a leak via a CString somewhere.

          G Offline
          G Offline
          GDavy
          wrote on last edited by
          #4

          ah you beat me to it... gotta type a little faster next time :-D

          D 1 Reply Last reply
          0
          • G GDavy

            ah you beat me to it... gotta type a little faster next time :-D

            D Offline
            D Offline
            Diddy
            wrote on last edited by
            #5

            :) Well they gets two answers to their Q not just one - effeciant this CP message board eh.

            1 Reply Last reply
            0
            • G GDavy

              one way is dubble clicking on the line the other reading it.. first line says: strcore.cpp(118) etc etc etc says that the mem was allocated on line 118 of the strcore.cpp file...(but never deallocated) in your DBManager.cpp file line 32 you allocate memory that wasn^t deallocated same for PatternDoc.cpp line 508. as for in which situations that occurs... Debug!! put breakpoints and read carefull your new and delete statements! Regards, Davy

              J Offline
              J Offline
              JHAKAS
              wrote on last edited by
              #6

              Thanks i will check it and will come up back Leave your mark wherever you go

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups