Hi Emmanuel,

I've just tested with this change (on the latest trunk) and while the results seem to be streamed to the client immediately they are still cached in the server until the end. This means it is still very easy to get an OutOfMemoryError.

Thanks,

Martin


Some follow-up :

I have done many tests, and I successfully got a working server without having all the messages stored in memory, simply by changing the way the ExecutorFilter is instanciated. In LdapService, line 361, instead of :

       // Now inject an ExecutorFilter for the write operations
       // We use the same number of thread than the number of IoProcessor
       // (NOTE : this has to be double checked)
       ((DefaultIoFilterChainBuilder)chain).addLast( "executor",
new ExecutorFilter( new OrderedThreadPoolExecutor( getTcpTransport().getNbThreads() ),
                   IoEventType.WRITE ) );

use :

       // Now inject an ExecutorFilter for the write operations
       // We use the same number of thread than the number of IoProcessor
       // (NOTE : this has to be double checked)
       ((DefaultIoFilterChainBuilder)chain).addLast( "executor",
new ExecutorFilter( new OrderedThreadPoolExecutor( getTcpTransport().getNbThreads() ) ) );

Now, the executor is used in both ways, and it seems to work much better.

I still have to understand how the ExecutorFilter() is working in MINA, but at least, I think we cant release MINA 2.0.0 without a clear documentation about the way to use this executor filter !

Reply via email to