This is part of a program to generate random numbers (codes) and when there are more codes requested than are possible (hashset doesn't take duplicates) the program freezes, I tried to put in a try catch block but it didn't work, any suggestions??
Thanks
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
I would recommend and download ANTS Profiler from RedGate Software. It has a 14 days free trial. It will tell you exactly what line of code (even within the assembly) took how much time and where it got stuck.
Hope it helps!
0
Sam HobbsRank #108 · 20.5K reputationPosted Sep 10, 2010, 8:20 AM EDT
0
Do you know how to use the debugger to single-step through code and to see what the actual data is?
If it is freezing in Debug builds u will be lucky enough.
If you are running multilple threads.. may be thread synchronization issues. Check the memory usage of the app. it is growing then may be coz of memeory leaks.. try to look for un-managed objects.
may be unhandled exceptions causing some issue.. to check any of the exceptions thrown in this scenario from visual studio enable break on exceptions.. may be it will give a clue.
Difficult to guess the exact reason.. may be a profilers can give u some clues.
Mahesh ChandRank #1 · 393.4K reputationPosted Sep 9, 2010, 8:51 AM EDT
Hope it helps!
Sam HobbsRank #108 · 20.5K reputationPosted Sep 10, 2010, 8:20 AM EDT
krishna v30 reputationPosted Sep 11, 2010, 5:45 PM EDT
If you are running multilple threads.. may be thread synchronization issues. Check the memory usage of the app. it is growing then may be coz of memeory leaks.. try to look for un-managed objects.
may be unhandled exceptions causing some issue.. to check any of the exceptions thrown in this scenario from visual studio enable break on exceptions.. may be it will give a clue.
Difficult to guess the exact reason.. may be a profilers can give u some clues.