Details
Description
In reference to a question on the quickfixj-users list from 2012-04-25:
"1. Why are all the LinkedBlockingQueues unbounded in the EventHandlingStrategies?
We've found that if you have to go back to the beginning of a session and have a large amount of traffic to process you can end up with memory issues without using a bounded queue."
Both quickfix.mina.EventHandlingStrategy implementations contain a BlockingQueue of Messages, or a wrapper of Messages in the case of SingleThreadedEventHandlingStrategy, and both of these queues are unbounded. We had an issue where while trying to recover from a period of downtime, the resent traffic would fill this queue faster than it could be processed, leading the app to run out of memory. We solved this by overriding the classes locally and giving the queues a capacity of 5000.
I'd like to see this improvement made into the vanilla library. While hard coding to some large value less than Integer.MAX_VALUE would probably be an improvement, ideally this could become a configuration option or an optional parameter to the constructors of Initiators and Acceptors.