Tech Support > Microsoft Windows > Development Resources > PdhCollectQueryDataEx hangs
PdhCollectQueryDataEx hangs
Posted by Subrahmanya on May 12th, 2008


Hi All

I have an application that spawns nearly 100 processes at a time, when
those many processes are spawned at the same time the virtual memory
becomes almost full. I use PdhCollectQueryDataEx() function
periodically to get cpu, memory statistics of different processes. It
looks like when virtual memory becomes almost full the function
mentioned above or any other pdh....() function hangs. The function
does not return but hangs even after some of the processes are killed
to make some memory free. Did anyone face this problem? Why is it so?
what is the solution?

Thanks in advance
Subrahmanya

Posted by Sebastian G. on May 12th, 2008


Subrahmanya wrote:


A genuine bug? Heck, even in something as small as ZLib I found a bug in a
function that causes a crash when memory is low. Don't bother discussing
about more complex stuff, which is full of such problems.


Patch the bug in the source code and recompile it? Oops...

Posted by Subrahmanya on May 12th, 2008


On May 12, 10:59 am, "Sebastian G." <se...@seppig.de> wrote:
You are telling "Patch the bug in the source code and recompile it?"
how should I patch this inside my code? pdh...() functions are
provided by windows and other threads that I created in the
application are running fine. Are there any functions equivalent to
pdh..() functions that work fine even when memory is low?

Posted by Sebastian G. on May 12th, 2008


Subrahmanya wrote:



Which part of "Oops" didn't you get? :-)
Since Windows is closed source, you have to beg Microsoft for fixing this
for you.


Depends on where the bug is. Maybe the function itself, maybe one of its
callees, maybe one of the callees' callees? It's not like one could easily
reproduce your scenario, so maybe you should attach a debugger.


Similar Posts