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. ATL / WTL / STL
  4. ATL / IIS / EXE ???

ATL / IIS / EXE ???

Scheduled Pinned Locked Moved ATL / WTL / STL
c++helpcomsysadminwindows-admin
13 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.
  • G Gerald Schwab

    Compile a debug version of your DLL and attach your debugger to DLLHOST.exe. Debug as usual.

    P Offline
    P Offline
    Peter Weyzen
    wrote on last edited by
    #3

    oh... I wish it were that simple.... But tracking memory leaks is the real problem... and it's not MFC.... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

    G 1 Reply Last reply
    0
    • P Peter Weyzen

      oh... I wish it were that simple.... But tracking memory leaks is the real problem... and it's not MFC.... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

      G Offline
      G Offline
      Gerald Schwab
      wrote on last edited by
      #4

      I'm not sure I understand what your getting at. You asked "Is there a good way to debug this?". I explained how to do this. Why is it any different to track memory leaks in a dll? What does MFC have to do with anything?

      P 1 Reply Last reply
      0
      • G Gerald Schwab

        I'm not sure I understand what your getting at. You asked "Is there a good way to debug this?". I explained how to do this. Why is it any different to track memory leaks in a dll? What does MFC have to do with anything?

        P Offline
        P Offline
        Peter Weyzen
        wrote on last edited by
        #5

        Forgive me for my ignorance in this arena. It's code that was kinda thrown at me, and finally given all responsibility to figure out. I'll be more specific. It's an ISAPI DLL which mines data out of our servers, generates some XML and passes it back to IIS for display. Upon repeated use, it leaks memory... My attempts to locate the memory leak are failing, and i am flailing :) Maybe you could tell me the best way to detect memory leaks in a situation like this? Thanks -peter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

        G 1 Reply Last reply
        0
        • P Peter Weyzen

          Forgive me for my ignorance in this arena. It's code that was kinda thrown at me, and finally given all responsibility to figure out. I'll be more specific. It's an ISAPI DLL which mines data out of our servers, generates some XML and passes it back to IIS for display. Upon repeated use, it leaks memory... My attempts to locate the memory leak are failing, and i am flailing :) Maybe you could tell me the best way to detect memory leaks in a situation like this? Thanks -peter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

          G Offline
          G Offline
          Gerald Schwab
          wrote on last edited by
          #6

          Well, I'm no memory leak detection expert, so you might want to start with this: http://msdn.microsoft.com/library/en-us/vsdebug/html/vxconDetectingIsolatingMemoryLeaks.asp?frame=true[^]

          P 1 Reply Last reply
          0
          • G Gerald Schwab

            Well, I'm no memory leak detection expert, so you might want to start with this: http://msdn.microsoft.com/library/en-us/vsdebug/html/vxconDetectingIsolatingMemoryLeaks.asp?frame=true[^]

            P Offline
            P Offline
            Peter Weyzen
            wrote on last edited by
            #7

            Thanks for the reference. I've always wondered where that came from. It's something you get by default using MFC. (that's where my MFC remark came from). Anyhow -- thanks -peter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

            D 1 Reply Last reply
            0
            • P Peter Weyzen

              Thanks for the reference. I've always wondered where that came from. It's something you get by default using MFC. (that's where my MFC remark came from). Anyhow -- thanks -peter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

              D Offline
              D Offline
              dcudev lcr
              wrote on last edited by
              #8

              Some memory leak tips, start looking for misbehaving BSTRS, unreleased components and unfreed mallocs. Also you can use the perfmon and taskmanager to monitor the memory as you debug... sun.lcr

              P 1 Reply Last reply
              0
              • D dcudev lcr

                Some memory leak tips, start looking for misbehaving BSTRS, unreleased components and unfreed mallocs. Also you can use the perfmon and taskmanager to monitor the memory as you debug... sun.lcr

                P Offline
                P Offline
                Peter Weyzen
                wrote on last edited by
                #9

                I should assert here that I undersand the basics of memory leak issues. But I need "special help" in the area of an IIS addin (ISAPI DLL). What's special about this kinda of app, is: * you write a dll * it get's loaded either directly by IIS (inetinfo.exe) * or indirectly via DLLHOST * you don't have much control of the environment All of the standard memory leak issues are covered. * balancing a delete for every new * releasing COM stuff The unknowns are: * ISAPI DLL issues * BSTR's * MSXML3 memory issues ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

                D 1 Reply Last reply
                0
                • P Peter Weyzen

                  I should assert here that I undersand the basics of memory leak issues. But I need "special help" in the area of an IIS addin (ISAPI DLL). What's special about this kinda of app, is: * you write a dll * it get's loaded either directly by IIS (inetinfo.exe) * or indirectly via DLLHOST * you don't have much control of the environment All of the standard memory leak issues are covered. * balancing a delete for every new * releasing COM stuff The unknowns are: * ISAPI DLL issues * BSTR's * MSXML3 memory issues ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

                  D Offline
                  D Offline
                  dcudev lcr
                  wrote on last edited by
                  #10

                  why not write you own dllhost and call/load the isap dll from there. this way you would have complete control of the loading process. as you know by now, the isapi dll is nothing more than a regular dll with a bunch of entry points of which only 2 or 3 are the most important ones. In any case, you can create a special entry point to fake the call for iis and watch the memory run... just a thought... ;) sun.lcr

                  P 1 Reply Last reply
                  0
                  • D dcudev lcr

                    why not write you own dllhost and call/load the isap dll from there. this way you would have complete control of the loading process. as you know by now, the isapi dll is nothing more than a regular dll with a bunch of entry points of which only 2 or 3 are the most important ones. In any case, you can create a special entry point to fake the call for iis and watch the memory run... just a thought... ;) sun.lcr

                    P Offline
                    P Offline
                    Peter Weyzen
                    wrote on last edited by
                    #11

                    Do you know of a good reference "out there somewhere" that details this? [i have too many tasks on my plate to re-invent this] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

                    D 1 Reply Last reply
                    0
                    • P Peter Weyzen

                      Do you know of a good reference "out there somewhere" that details this? [i have too many tasks on my plate to re-invent this] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

                      D Offline
                      D Offline
                      dcudev lcr
                      wrote on last edited by
                      #12

                      not really, I had a similar experience with windows services where they run in the background and are hard to reach via the debugger. I took control of taht by creating a main function that can be compiled into an exe and the service portion is a dll. the main portion had all the serivce handles and that allows me to control what gets loaded where. I also had to spend some three month back and forth with MS but in the final analysis it was my main that really helped me. I have a book at home that details the isapi ia easy to understand format, i'll get the ref number and email it to you tomorrow... as they used to say a few months back... hope is on the way.... :) sun.lcr

                      P 1 Reply Last reply
                      0
                      • D dcudev lcr

                        not really, I had a similar experience with windows services where they run in the background and are hard to reach via the debugger. I took control of taht by creating a main function that can be compiled into an exe and the service portion is a dll. the main portion had all the serivce handles and that allows me to control what gets loaded where. I also had to spend some three month back and forth with MS but in the final analysis it was my main that really helped me. I have a book at home that details the isapi ia easy to understand format, i'll get the ref number and email it to you tomorrow... as they used to say a few months back... hope is on the way.... :) sun.lcr

                        P Offline
                        P Offline
                        Peter Weyzen
                        wrote on last edited by
                        #13

                        Thanks! It is most appreciated! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

                        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