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. Resource Leak [modified]

Resource Leak [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
cssperformancequestionlearning
4 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.
  • O Offline
    O Offline
    od ananzi co za
    wrote on last edited by
    #1

    I have a resource leak that I have thus far been unable to track down. I am using Process Explorer and Task Manager and am monitoring every counter that they are able to monitor. All counters are stable, ie there are no memory leaks, handle leaks, etc that I can detect. However, after my program has run for an hour or so all applications and Windows start giving a whole range of errors, but all of them are related to lack of resources. The only thing so far that is interesting is the Virtual Size value in Process Explorer. It stands at about 1,2GB, while my process's Working Set and Private Bytes is less than 70MB. All other resources are 100% stable after my application started up. I have enable Microsoft Application Verifier and set GFLAGS to enable all the Heap functions for my process. Alas, no errors. I've also tried Memory Validator, but it gives 100's of errors of uninitialized variables, all in MS code, nothing else really that matters. Are there other utilities that will enable me to track the actual resource that is leaking ? Any other suggestions maybe as to what type of "undetectable" leak I am experiencing ? Thanks OD

    modified on Friday, July 31, 2009 3:47 PM

    R L O 3 Replies Last reply
    0
    • O od ananzi co za

      I have a resource leak that I have thus far been unable to track down. I am using Process Explorer and Task Manager and am monitoring every counter that they are able to monitor. All counters are stable, ie there are no memory leaks, handle leaks, etc that I can detect. However, after my program has run for an hour or so all applications and Windows start giving a whole range of errors, but all of them are related to lack of resources. The only thing so far that is interesting is the Virtual Size value in Process Explorer. It stands at about 1,2GB, while my process's Working Set and Private Bytes is less than 70MB. All other resources are 100% stable after my application started up. I have enable Microsoft Application Verifier and set GFLAGS to enable all the Heap functions for my process. Alas, no errors. I've also tried Memory Validator, but it gives 100's of errors of uninitialized variables, all in MS code, nothing else really that matters. Are there other utilities that will enable me to track the actual resource that is leaking ? Any other suggestions maybe as to what type of "undetectable" leak I am experiencing ? Thanks OD

      modified on Friday, July 31, 2009 3:47 PM

      R Offline
      R Offline
      RomanMzh
      wrote on last edited by
      #2

      A bit more description would be more helpful but not as much as debugging the code, especially places that work with buffers ( strings etc) system managed handles (GDI objects, Global memory etc). Also:

      od@ananzi.co.za wrote:

      all in MS code, nothing else really that matters.

      It is very possible that YOUR code uses win32 APIs incorrectly causing one of any number of possible leaks.

      1 Reply Last reply
      0
      • O od ananzi co za

        I have a resource leak that I have thus far been unable to track down. I am using Process Explorer and Task Manager and am monitoring every counter that they are able to monitor. All counters are stable, ie there are no memory leaks, handle leaks, etc that I can detect. However, after my program has run for an hour or so all applications and Windows start giving a whole range of errors, but all of them are related to lack of resources. The only thing so far that is interesting is the Virtual Size value in Process Explorer. It stands at about 1,2GB, while my process's Working Set and Private Bytes is less than 70MB. All other resources are 100% stable after my application started up. I have enable Microsoft Application Verifier and set GFLAGS to enable all the Heap functions for my process. Alas, no errors. I've also tried Memory Validator, but it gives 100's of errors of uninitialized variables, all in MS code, nothing else really that matters. Are there other utilities that will enable me to track the actual resource that is leaking ? Any other suggestions maybe as to what type of "undetectable" leak I am experiencing ? Thanks OD

        modified on Friday, July 31, 2009 3:47 PM

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I agree with RomanMzh in that it sounds like a GDI resource leak. You can use the task manager to see how many GDI objects your application is using. This MSDN Magazine article should give you enough information to track it down. Resource Leaks: Detecting, Locating, and Repairing Your Leaky GDI Code[^] Essentially all you need to do is select the 'GDI Objects' checkbox in the select columns dialog. I would recommend selecting 'Handle Count' as well. If either your GDI objects or handle count continues to increment... you may have a leak. Best Wishes, -David Delaune

        1 Reply Last reply
        0
        • O od ananzi co za

          I have a resource leak that I have thus far been unable to track down. I am using Process Explorer and Task Manager and am monitoring every counter that they are able to monitor. All counters are stable, ie there are no memory leaks, handle leaks, etc that I can detect. However, after my program has run for an hour or so all applications and Windows start giving a whole range of errors, but all of them are related to lack of resources. The only thing so far that is interesting is the Virtual Size value in Process Explorer. It stands at about 1,2GB, while my process's Working Set and Private Bytes is less than 70MB. All other resources are 100% stable after my application started up. I have enable Microsoft Application Verifier and set GFLAGS to enable all the Heap functions for my process. Alas, no errors. I've also tried Memory Validator, but it gives 100's of errors of uninitialized variables, all in MS code, nothing else really that matters. Are there other utilities that will enable me to track the actual resource that is leaking ? Any other suggestions maybe as to what type of "undetectable" leak I am experiencing ? Thanks OD

          modified on Friday, July 31, 2009 3:47 PM

          O Offline
          O Offline
          od ananzi co za
          wrote on last edited by
          #4

          Hi Guys, I've managed to track down the "leak". The application uses a mailslot to send some frequent statistical data to another process for display. The receiving program was receiving the data a lot slower than the sender was transmitting it, so eventually the Mailslot IPC ran out of shared memory and from there all the problems started.

          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