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. Tracing memory leaks in VC++ 6

Tracing memory leaks in VC++ 6

Scheduled Pinned Locked Moved C / C++ / MFC
c++performancequestion
13 Posts 2 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.
  • F Fahr

    Hello all, I am having some troubles with tracing memory leaks in VC++ 6. I have a program which includes a bunch of DLLs, now when I execute it and shut it, it dumps quite a bit of garbage from memory. Usually it states where the object was created, but in this case it doesn't, it only dumps objects. This leads me to believe that the memory leak is generated in one of the linked DLLs. Is there any trick or program which can figure out where the memory leak comes from? I have no idea where it originates and I'd like to clean it up... Thanks, - Fahr

    L Offline
    L Offline
    Larry J Siddens
    wrote on last edited by
    #2

    Did you take a look at the bottom of the "Debug" pane? That shows where they usally come from? (I assume you have done that). Next, do you have access to the dll source code? There is an application that will determine memory leaks, but I cannot think of it right now... Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

    F 1 Reply Last reply
    0
    • L Larry J Siddens

      Did you take a look at the bottom of the "Debug" pane? That shows where they usally come from? (I assume you have done that). Next, do you have access to the dll source code? There is an application that will determine memory leaks, but I cannot think of it right now... Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

      F Offline
      F Offline
      Fahr
      wrote on last edited by
      #3

      I have access to the source of all the DLLs. And like I said; it does NOT state the origin of the memory leaks, it must be one of the DLLs, but I can't figure out which one. Please remember the title of that program! :)

      L 1 Reply Last reply
      0
      • F Fahr

        I have access to the source of all the DLLs. And like I said; it does NOT state the origin of the memory leaks, it must be one of the DLLs, but I can't figure out which one. Please remember the title of that program! :)

        L Offline
        L Offline
        Larry J Siddens
        wrote on last edited by
        #4

        Make sure you build all the dll's in Debug. Run you application in Debug (inside the studio). Exit your application (when you know that the leaks (or suspected leaks occurre)). Open the output pane window, click the "Debug" tab, then go to the bottom. If there are memory leaks (that VS can find) they will be listed. Then if you double click on the source file, it will take you to where the item was created and then not released. Again, I am assuming that you have done all this. Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

        F 1 Reply Last reply
        0
        • L Larry J Siddens

          Make sure you build all the dll's in Debug. Run you application in Debug (inside the studio). Exit your application (when you know that the leaks (or suspected leaks occurre)). Open the output pane window, click the "Debug" tab, then go to the bottom. If there are memory leaks (that VS can find) they will be listed. Then if you double click on the source file, it will take you to where the item was created and then not released. Again, I am assuming that you have done all this. Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

          F Offline
          F Offline
          Fahr
          wrote on last edited by
          #5

          Yes, I have done it all. The point is that I DO see a HUGE list of memory leaks, I have a slight idea from which DLL and even class they come, but it wont give out any source files and/or lines. Only dumps objects...

          L 1 Reply Last reply
          0
          • F Fahr

            Yes, I have done it all. The point is that I DO see a HUGE list of memory leaks, I have a slight idea from which DLL and even class they come, but it wont give out any source files and/or lines. Only dumps objects...

            L Offline
            L Offline
            Larry J Siddens
            wrote on last edited by
            #6

            Now I'm confused. I have several projects that I check that are built (the whole project including the dll's) and when there is a leak, it will give me the file/line of the offending object even if it is in the dll! When you compile your project, is the dll a dependency(sp) of the main project? Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

            F 1 Reply Last reply
            0
            • L Larry J Siddens

              Now I'm confused. I have several projects that I check that are built (the whole project including the dll's) and when there is a leak, it will give me the file/line of the offending object even if it is in the dll! When you compile your project, is the dll a dependency(sp) of the main project? Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

              F Offline
              F Offline
              Fahr
              wrote on last edited by
              #7

              No, they're not dependencies. We have multiple actual programs which use the same shared DLLs, so the DLLs are mostly standalone projects alltogether. You think I can trace the leaks when I include the DLLs in question in the workspace of my project?

              L 1 Reply Last reply
              0
              • F Fahr

                No, they're not dependencies. We have multiple actual programs which use the same shared DLLs, so the DLLs are mostly standalone projects alltogether. You think I can trace the leaks when I include the DLLs in question in the workspace of my project?

                L Offline
                L Offline
                Larry J Siddens
                wrote on last edited by
                #8

                Yep I do. I thought you were already doing that. Do you know how to make them a dependancy? I'm assuming yes. Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

                F 1 Reply Last reply
                0
                • L Larry J Siddens

                  Yep I do. I thought you were already doing that. Do you know how to make them a dependancy? I'm assuming yes. Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

                  F Offline
                  F Offline
                  Fahr
                  wrote on last edited by
                  #9

                  I guess just adding them to the workspace will do the trick, no? If not, then please tell me :) - Fahr

                  L 1 Reply Last reply
                  0
                  • F Fahr

                    I guess just adding them to the workspace will do the trick, no? If not, then please tell me :) - Fahr

                    L Offline
                    L Offline
                    Larry J Siddens
                    wrote on last edited by
                    #10

                    Yes. But you have to make sure that the main exe project depends upon these dll's. This is done by: In the File View, right click on the "Workspace", Select "Insert Project into Workspace", when the dialog comes up, select the project to insert (the DLL in question), then check the "Dependency of" and select the main exe. When finished, make sure that you have "Debug" selected as the build and do a "Build All". This will compile the files for the DLL and your exe that uses them. Run the puppy and see what happens. Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

                    F 1 Reply Last reply
                    0
                    • L Larry J Siddens

                      Yes. But you have to make sure that the main exe project depends upon these dll's. This is done by: In the File View, right click on the "Workspace", Select "Insert Project into Workspace", when the dialog comes up, select the project to insert (the DLL in question), then check the "Dependency of" and select the main exe. When finished, make sure that you have "Debug" selected as the build and do a "Build All". This will compile the files for the DLL and your exe that uses them. Run the puppy and see what happens. Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

                      F Offline
                      F Offline
                      Fahr
                      wrote on last edited by
                      #11

                      Ok, I will try this when I'm back at work tomorrow :) Thanks a lot for the info, I'll let you know how it ended :) - Fahr

                      L 1 Reply Last reply
                      0
                      • F Fahr

                        Ok, I will try this when I'm back at work tomorrow :) Thanks a lot for the info, I'll let you know how it ended :) - Fahr

                        L Offline
                        L Offline
                        Larry J Siddens
                        wrote on last edited by
                        #12

                        Any luck? Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

                        F 1 Reply Last reply
                        0
                        • L Larry J Siddens

                          Any luck? Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

                          F Offline
                          F Offline
                          Fahr
                          wrote on last edited by
                          #13

                          eh, sorry, forgot to reply... it all worked out fine :) Mem leaks found and resolved, thanks a lot for the tip! :)

                          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