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