[xSocket-develop] Silent 'Out of Memory' Exception cause clients to miss data (server's onData meth
Status: Inactive
Brought to you by:
grro
|
From: Anri D. <anr...@gm...> - 2009-05-22 05:42:39
|
Hi, I wrote a simple test starting a server and connecting 10 NonBlockingConnection clients. Each client connects and sends a string to the server, and then waits for an echo before it disconnects. The server's onData() handler method does some "heavy" processing, and then sleeps randomly for 1-1000 ms, before sending the echo to the client. This is done to simulate server-side processing, which takes does take time when disk I/O (db calls etc) is taken into the picture. The test kept failing for no apparent reason with some of the 10 clients never receiving their echo. Running the exact same test using Apache Mina produced a 'Out of Memory' Exception. Increasing the JVM memory to a max of 256 mb (using the java args -Xms40m -Xmx256m) immediately solved the issue, for both Mina AND xSocket. The strange thing is that xSocket didn't throw any exceptions, or simply swallowed them up without logging anything (default logging settings). Perhaps this should be made more obvious in the tutorial ? I've included my test in this email (uses JUnit 4.5 and SLF4J) Cheers, - Anri |