MINA 1.X is way old. Would recommend you to upgrade to the latest MINA release.

Try migrating. Some of the differences are listed here
http://mina.apache.org/changes-between-2x-and-1x.html

thanks
ashish

On Tue, Mar 16, 2010 at 8:26 PM, Cleber Cassol <ccas...@gmail.com> wrote:
> Hi there.
>
> We are using Mina 1.1.7 for some time now. We are developing a system that
> will act as a proxy between our clients (e-mail clients like Thunderbird,
> cell phones and so on) and our IMAP mail server. Basically, a client
> connects and sends IMAP commands. Then, the proxy parses those commands if
> necessary, drops them if they can't be handled by us and ultimately sends
> those commands to our mail server. The mail server responds accordingly and
> the proxy simply passes its responses to the client. Our production
> environment so far:
>
> Mina Version 1.1.7
> java version "1.6.0_12"
> Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
> Java HotSpot(TM) 64-Bit Server VM (build 11.2-b01, mixed mode)
> CENTOS Linux
>
> The problem is: even under a low load (about 50 requests per minute), the
> memory consumption is always increasing. After about 12 hours, our
> application begins swapping and eventually the JVM dies. After a lot of
> profiling it using JProfiler, we discovered that a lot of SocketIoSession
> objects were being held somewhere (more than 30.000). We are not using the
> ProxyFilter because no documentation on it was found. Basically, we do the
> following:
>
> - Client requests a connection
> - Acceptor accepts it and then we start receiving commands
> - After authentication, the Connector connects to our mail server and pass
> the received commands through it.
> - The mail server responds and its responses are passed back to the client
>
> So, we have two IoSession objects per client. One for the client and the
> proxy, another for the proxy and the mail server. It has to be that way
> because every connection with the IMAP mail server must be authenticated for
> one user, thus we cannot reuse the same connection for sending requests for
> various users. Our mail server has a limited capacity, so we have to cut
> idle connections with it after 5 seconds. There's a thread for that task.
> This thread sweeps the Acceptor's and Connector's managedConnections
> collection and, if getLastWriteTime() returns something that indicates it's
> been idle for more than 5 seconds, it closes the connection and remove it
> from the respective collection.
>
> One single IMAP command can generate A LOT of responses. For example, when
> the e-mail client is downloading a big message with attachments on it. Also,
> an APPEND command generates a lot of binary requests to store the data. I
> don't know where to look anymore. I've also tried to use heap buffers, but
> now our application crashes after 3 or 4 days. It's better, but there's
> still a leak somewhere. Could you lend me some hand and help me find it? If
> it's MINA related, of course.
>
> Thank you very much for your attention. I'll gladly send you any resources
> you may find useful.

Reply via email to