I am migrating my application from RFA 7.0.0 to RFA 7.6.1.
But I am facing a problem with the eventQueue : its size is getting bigger and bigger until I get OutOfMemoryException. It is strange because with RFA 7.0.0 ( and JDK5), we did not have this issue.
In the examples of RFA, I found this MDSubscribeSyncDemo example. But this one is performing a snapshot subscription, which is not what I need. Does someone has an idea How to perform many subscription to a session, synchronously?
Did anyone faced this OutOfMemory exception caused by the eventQueue?
In terms of the example you mention, the command line parameter -itemName can take a comma separated list of RICs. The code then iterates through the list and requests each item synchronously.
The subscribeSync method is a blocking method which will not return until an image or close status event is received and is only intended for snapshot subscriptions.
If you want to make streaming subscriptions then you can use the asynchronous technique as demonstrated in the similar MDSubDemo example.
However, please note that the MarketData interface is legacy and if you are planning to rewrite applications then you should use the newer OMM based interfaces and even consider rewriting your code using the Java Elektron Message API (EMA) which is part of the Elektron SDK. EMA is an ease of use layer which is typically much easier to learn, develop and maintain - and will also continue to benefit from enhancements in the future.
With regards your OutOfMemory issue I recommend you open a ticket with our support team who can help perform any required in depth diagnostic.
Hi @Umer Nalla
Thank you for your answer.
For now, we are not planning to rewrite the application. We are migrating from FRA 7.0.0 to RFA 7.6.1 and we suppose that this will be enough to connect to new TREP3 servers.
Do you think it is enough?
@wajdi.benslimane in addition to excellent suggestions provided above, the underlying reason for out of memory, is most likely that your consumer is not processing the new events fast enough. Try to optimize the event dispatch loop (processEvent).