Hi all !
I am really happy with MINA. It's a must have in our free devel!

I come back after a while getting more in development process
using MINA and I have some comments and one problem (see title).

Comments:
- I found that the memory issue I got before was a bit relative to the number
 of new session created. The more I have new session, even if they closed
 very quickly, the more the server and the client use memory.
 It is not linear to the number of session opened during time but
 the impact can be reproduced easily.
 And it seems that when everything is finished (client waiting for
 nothing in a big sleep and server waiting for new session), the
 memory is not going really down.
 For instance (under Windows testing) : All processes starting with 18Mb
 - 8 sessions with each 400 messages in both ways => around 40 Mb
    After a while (MINA Garbage collector) -> around 36Mb
 - 3200 sessions (with each 1 message in both ways) => around 90 Mb
    After a while (MINA GC) -> around 80 Mb
Everything is similar except the way session are done
(in first part, 1 session for many messages, in second, 1 session/message).
I don't knwo precisely why but it seems related to the high number
of sessions...

- In order to have a close.join() feature according to my desire,
 I have implemented on top of MINA a "business" way:
 - for my particular needs, I have some data to check if the session
  is ready to be closed
 - when I want to close a session, I first wait that all scheduledWriteRequest
  is 0 then I close.

Now my problem I found in MINA unbindAll():
==========================================
I wanted to offer a function to shutdown gracefully the server,
that is to say that the server doesn't accept new connection,
but does let already connected client to finished correctly
their session (which are multi messages related).
In the beginning I used:
- setDisconnectOnUnbind(false)
- unbindAll()
- wait in my business logic that all already connected users shutting down
- setDisconnectOnUnbind(true)
- unbindAll()

I've got a lot of freeze (using 6 clients making a lot of messages)
in either the first or the second unbindAll().

So I simplify like this:
- wait in my business logic that all already connected users shutting down
  and does not accept new connection by hand (business logic)
- setDisconnectOnUnbind(true)
- unbindAll()

And I still have easily a freeze in the server during the call to
unbindAll().
If I have only 1 client, unbindAll is not blocking (up to now).
If I have 3 to 6 clients, making their stuff, they all disconnected
correctly from the server (to make them disconnected, either
they receive a message that said "End of Session" so they closed,
or the server is closing the session itself.
But the server often blocks in the call of unbindAll().
Note that I use a different acceptor to get the server shutdown,
so the unbindAll is not related to the session used to get it down.

I am no able at this time to see where is the problem in MINA.
The only thing I can tell now is that it is blocling during the
call of unbindAll().

Hope this can help.

However, great job !

Frederic

Reply via email to