[QFJ-678] EventHandlingStrategy BlockingQueues are unbounded Created: 02/May/12  Updated: 02/Apr/15  Resolved: 20/Oct/14

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.5.0, 1.5.2
Fix Version/s: 1.6.0

Type: Improvement Priority: Minor
Reporter: Greg Chabala Assignee: Christoph John
Resolution: Fixed Votes: 0
Labels: None


 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.



 Comments   
Comment by Christoph John [ 20/Oct/14 ]
  • changed Acceptor/Initiator/EventHandlingStrategy to use a default of 10000 as queue size in order to avoid OutOfMemory issues
  • queue size can be specified using the respective (Threaded)SocketAcceptor/Initiator constructors
Generated at Mon Apr 29 16:24:06 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.