Note that there are some explanatory texts on larger screens.

plurals
  1. POOut of memory on _beginthreadex
    primarykey
    data
    text
    <p> I currently debug a multi threaded application, which runs without errors until some functions where called about 2000 times. After that the application stops responding, which I could track down to _beginthreadex failing with an out of memory error. </p> <p> When examining the Application in ProcessExplorer I can see a growing number of thread handles leaked and a growing virtual memory until the error occurs, the private bytes stay low. The leaked threads also call CoInitialize and never call CoUninitialize. </p> <p>What I would like to know is:<br/></p> <ul> <li>What does the Virtual memory represent ?</li> <li>Is the virtual memory related to the leaked thread handles?</li> <li>Does COM or MSXML6 (called by the threads) copy thread handles and how can I Close them?</li> </ul> <p> I hope that my question is clear and doesn't break any roules,it is my first question and english isn't my first language.:-( </p> <p> I forgot to mention, I close the handles returned by _beginthreadex once the threads get terminated, which reduces the number of open handles by about half but does not affect the virtual memory. Additionally before i inserted the CloseHandle call each thread handle shown in ProcessExplorer had a handle count of two for the thread. </p> <p><strong>Edit</strong></p> <p> I fell stupid for not including this before, I know that the threads exit as the number of active threads while debugging with visual studio does not grow. And I do hope that not all of the leaked memory is a result of calls to TerminateThread as they are used in a rather big library and I would prefer not modifying that. </p> <p> To the com part of my question, with !htrace -diff i find thread handles allocated by msxml but not freed after the functioncalls end, could they be related to the leak or will they be Closed at a later time? </p> <p><p> Thanks for all those comments, while the problem is still there they helped me understand it better.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload