Memory Leak

AhmedHindy used Ask the Experts™
Does Windows XP Handles Memory Leak after Program Terminates? What are the Operating System that handles it?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Process owns his memory and usually it's freed when last thread terminates. Sometimes there are processes (i.e. audio mixer in XP without sp1) which "touches" such memory and it remains allocated. Simplest way to detect such situation is to run !process 0 0 from windbg. You can alse free it there.
But it's very uncommon and probably your proces frees his own memory.


First Thanks for Your response but would You please Give me More Accurate and detailed Answer
Like What happens when Program Terminates ?(which means a request will be sent to OS and then Os Searches for the Memory Occupied by this Program then Look if there was a leak or not and What kind of that leak ...etc)

Process = threads + memory.
If you terminate last thread - memory is disposed by OS.
There are some methods of touching memory which cause OS thinking memory is still in use even if the last thread terminates. But this is a very special case.
Even if this occurs should not slow down your computer because memory not accessed by threads will be paged to the disk.
You can also use meminfo from Alex Ionescu (co-author of the deepest system internals book ever). It's linked on the bottom of
Blog post explains some leaks I wrote about. Utility will show them in your system.
However I'm still thinking it's really rare case even with leaking apps.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial