The reason that my server keeps crashing is because it runs out of memory.
(From: @Jon Skeet) The fact that you’re looping over a collection and conditionally adding to it looks suspect to me. It’s possible that it’s just looping forever, because it adds an item, then finds that item and adds another, then adds another etc. The stack trace you’ve got may just be one that was taken within the infinite loop, or possibly on running out of memory. You should be adding more diagnostics so you can see how the code is executing.
By looping through a collection that I am adding values to is not correct, because what would end up happening is that objects will continue to be added at the same position forever.
Instead what I should have done is to sort the array after it’s been populated. A simple shuttle sort would have fixed this.
solved Date Parsing Operation Crashes Server