I'm running Embarcadero RAD Studio 2010 (C++) and have used AQTime a bit to check for some leaks. I wonder if there is a good way to pinpoint the origin in my code of a large amount of threads that seem to never die. They are created during the night so I don't see them as it happens but I would like to be able to go back and see which parts of the code that has generated the most threads and use that information in my detective work.
I would try using the Allocation Profiler with only one active area containing only the TTHread class. Start profiling and let it work overnight. When you come in next morning, click Get Results in AQtime. As a result, you will see all TTHread instances in the report, and the Details panel will show the creation call stack for each of them. To minimize the amount of data collected, I would probably set the "Collect stack information" setting of the profiler to "By routines" - this will not give you the line numbers, but this may be a good starting point to find out what happens inside.
If I would need further details, I would use the information collected on the first step to run the app under the Function Trace profiler with the Areas set up in a way when only the rutines I need are included (based on the creation call stacks identified before). This would give me the complete information on the subject.
Read about profiling areas here: http://smartbear.com/support/viewarticle/17895/
And check the profilers descriptions here:
Allocation: http://smartbear.com/support/viewarticle/18030/
Function Trace: http://smartbear.com/support/viewarticle/17971/
Does this suggestion work in your case?