I am looking for techniques to use Sockets with no GCable objects created. I am looking for this as I am trying to create an application which would run on Java with GC disabled for latency. (A technique discussed here: http://www.infoq.com/presentations/Extreme-FIX-Messaging-for-Low-Latency) It will receive a few million messages per second. The system can only be re started on weekly basis at the most as FX markets are open 24 hours on working days. If monitoring after market hours which would be even worse. Thus I do not have the luxury create any new objects after the system starts as this will leak memory. E.g. if I read a byte buffer which is an array object this will need to be GCed thus will run out of memory quick. I am not very sure about how efficient escape analysis on the JVM in this context as perhaps there is a chance that objects can escape.
Products like http://www.rapidaddition.com/ claim that they do not produce any GCable objects after stating up as per above presentation. This product is proprietary thus I do cannot find out how exactly this is done. If you have used any techniques to achieve similar results I would be interested in knowing how.
I am looking for the ability to read data from sockets with either.
- buffer is re used
- return only primitive data as this will need not be GCed
It should internally perform such scheme like object pooling or some other technique where there is no new objects created.
Some material I uncovered suggests frameworks like Netty, Grizzly, Mina, xSocket have some GC overhead.
http://www.znetdevelopment.com/blogs/2009/04/09/scalable-nio-servers-part-2-memory/
Other bloggs in the series:
- http://www.znetdevelopment.com/blogs/2009/04/07/scalable-nio-servers-part-1-performance/
- http://www.znetdevelopment.com/blogs/2009/04/13/scalable-nio-servers-part-3-features/
- http://www.znetdevelopment.com/blogs/2009/04/20/scalable-nio-servers-part-4-protocol/
Some additional background information: http://www.youtube.com/watch?v=5LQNesmht4o http://www.infoq.com/presentations/Progressive-Architectures-at-the-Royal-Bank-of-Scotland