Click here to Skip to main content
15,899,025 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have a windows service that contains a memory leak. I am currently using PerfMon to determine where the leak is located. While my service is in the process of building report pdf's from DataSets and CrystalReports, my "# Bytes in all Heaps" is in check, and it being collected just fine. However my "Private Bytes" is very slowing growing, and after producing 10,000 reports is some 500 MB greater than the size of my "Bytes in all Heaps".


My application is running producing these reports in multiple threads. The main issue is that when I look at "# of current logical Threads", and "# of current recognized threads", the counters are all over the place. One second I will have a resonable number like 2-10, and then it will spike to 4,294,967,295, and it's back to 2-10.


The counter for "# of current logical Threads" did this spiking for a while, and then just finally stayed up around 4,294,967,236 fluctuating by about 10 in either direction.



Is my PerMon messed up, or is it my threading model?


It's only when I run large sets of reports that I run into this issue, otherwise the memory is kept in check. Oh, and the number of threads that are allowed to execute at a given moment is limited to the number of cores on the box.

Posted
Comments
Keith Barrow 28-Oct-10 3:56am    
I don't know the answer to your question, so I'm adding a comment. My developer-chops tell me this is a problem with either perfmon or your possible your OS. Just spawning ~4.3 billion threads would take some time, your machine would almost certainly freeze if even a small percentage of these is running. Additionally, the number you quote is 2^32 - 1, so something fishy is going on. Try running you app on a different machine.

The number 4,294,967,295 is only when applied unsigned. When you would look at this as signed, this would mean -1. Maybe you should look up what that means. It probably means that there are no recognized threads at all but I didn't verify this.

Good luck!
 
Share this answer
 
I now know that my leak is not in the threads, and is actually inside of Crystal Reports. I still have no idea why my thread count was bouncing all over the place, and yes, the number looked a little fishy.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900