You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Maziyar Eslamieh <ma...@yahoo.com> on 2008/06/12 18:16:02 UTC

problem:outof memory error

Hi all
Can you help me?
I am using MINA2 in my messaging system.
This system is a server that send and receive text message. 
I use this filter in my server:
   acceptor.getFilterChain().addLast(
                "codec",
                new ProtocolCodecFilter(new TextLineCodecFactory(Charset
                        .forName("UTF-8"))));

I have two scenario:
1) this server send 500 msg per second and client replay to this
2) this server receive  500 msg per second from client and replay to client

as result server send and receive 2000 msg/sec .
After one day system throw outofmemory exception and server is down.
my heap size is 2Gige.

what is your solution to this problem?
Do you check my source If i send this to forum ?
 


      

Re: AW: problem:outof memory error

Posted by Maziyar Eslamieh <ma...@yahoo.com>.
This is my memory dump of text generator(client-server) that i attached to last mail .
please check this and my project and help me.

--- On Mon, 6/16/08, Maziyar Eslamieh <ma...@yahoo.com> wrote:
From: Maziyar Eslamieh <ma...@yahoo.com>
Subject: Re: AW: problem:outof memory error
To: dev@mina.apache.org
Date: Monday, June 16, 2008, 9:21 AM

os=linux                      
ram 2GB
jvm version=sun-1.6.03         
jvm parameters=-server -Xms1600M -Xmx1600M  -XX:UseParallelGC


I send the source and diagram  of my project to resolve OOM Exception .
 
my problem  :
1- send and receive 100 message per second  from 6 client as   server side 
2-send and receive 100 message per second  from 6 server as client side 
you can see my  network topology  from image

i am using ExecuteFilter to create dedicated thread model  to handle sessions
  my program works normally  for one day  then i  get OOM Exception. 


--- On Fri, 6/13/08, Steve Ulrich <st...@proemion.com> wrote:

> From: Steve Ulrich <st...@proemion.com>
> Subject: AW: problem:outof memory error
> To: "dev@mina.apache.org" <de...@mina.apache.org>,
"maeslamieh@yahoo.com" <ma...@yahoo.com>
> Date: Friday, June 13, 2008, 11:22 AM
> Hi!
> Are you doing anything else than plain text decoding? Maybe
> there's a leak somewhere at your code, or maybe it takes
> too long to execute your code, so the received message pile
> up while your code is executed.
> To prevent the latter one, you can use an ExecutorFilter
> (put behind the Decoder) to separate the long running
> operations from the receiver/decoder and get a better
> scalability.
> If nothing helps: Try a profiler!
> 
> hth
> 
> Steve
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Maziyar Eslamieh [mailto:maeslamieh@yahoo.com]
> > Gesendet: Donnerstag, 12. Juni 2008 18:16
> > An: Forum MINA
> > Betreff: problem:outof memory error
> >
> > Hi all
> > Can you help me?
> > I am using MINA2 in my messaging system.
> > This system is a server that send and receive text
> message.
> > I use this filter in my server:
> >    acceptor.getFilterChain().addLast(
> >                 "codec",
> >                 new ProtocolCodecFilter(new
> > TextLineCodecFactory(Charset
> >                        
> .forName("UTF-8"))));
> >
> > I have two scenario:
> > 1) this server send 500 msg per second and client
> replay to this
> > 2) this server receive  500 msg per second from client
> and replay to
> > client
> >
> > as result server send and receive 2000 msg/sec .
> > After one day system throw outofmemory exception and
> server is down.
> > my heap size is 2Gige.
> >
> > what is your solution to this problem?
> > Do you check my source If i send this to forum ?
> >
> >
> >


      

Re: AW: problem:outof memory error

Posted by Maziyar Eslamieh <ma...@yahoo.com>.
This is my memory dump of text generator(client-server) that i attached to last mail .
please check this and my project and help me.


--- On Mon, 6/16/08, Maziyar Eslamieh <ma...@yahoo.com> wrote:

> From: Maziyar Eslamieh <ma...@yahoo.com>
> Subject: Re: AW: problem:outof memory error
> To: dev@mina.apache.org
> Date: Monday, June 16, 2008, 9:21 AM
> os=linux                      
> ram 2GB
> jvm version=sun-1.6.03         
> jvm parameters=-server -Xms1600M -Xmx1600M 
> -XX:UseParallelGC
> 
> 
> I send the source and diagram  of my project to resolve OOM
> Exception .
>  
> my problem  :
> 1- send and receive 100 message per second  from 6 client
> as   server side  2-send and receive 100 message per second
>  from 6 server as client side 
> you can see my  network topology  from image
> 
> i am using ExecuteFilter to create dedicated thread model 
> to handle sessions
>   my program works normally  for one day  then i  get OOM
> Exception. 
> 
> 
> --- On Fri, 6/13/08, Steve Ulrich
> <st...@proemion.com> wrote:
> 
> > From: Steve Ulrich <st...@proemion.com>
> > Subject: AW: problem:outof memory error
> > To: "dev@mina.apache.org"
> <de...@mina.apache.org>,
> "maeslamieh@yahoo.com"
> <ma...@yahoo.com>
> > Date: Friday, June 13, 2008, 11:22 AM
> > Hi!
> > Are you doing anything else than plain text decoding?
> Maybe
> > there's a leak somewhere at your code, or maybe it
> takes
> > too long to execute your code, so the received message
> pile
> > up while your code is executed.
> > To prevent the latter one, you can use an
> ExecutorFilter
> > (put behind the Decoder) to separate the long running
> > operations from the receiver/decoder and get a better
> > scalability.
> > If nothing helps: Try a profiler!
> > 
> > hth
> > 
> > Steve
> > 
> > > -----Ursprüngliche Nachricht-----
> > > Von: Maziyar Eslamieh
> [mailto:maeslamieh@yahoo.com]
> > > Gesendet: Donnerstag, 12. Juni 2008 18:16
> > > An: Forum MINA
> > > Betreff: problem:outof memory error
> > >
> > > Hi all
> > > Can you help me?
> > > I am using MINA2 in my messaging system.
> > > This system is a server that send and receive
> text
> > message.
> > > I use this filter in my server:
> > >    acceptor.getFilterChain().addLast(
> > >                 "codec",
> > >                 new ProtocolCodecFilter(new
> > > TextLineCodecFactory(Charset
> > >                        
> > .forName("UTF-8"))));
> > >
> > > I have two scenario:
> > > 1) this server send 500 msg per second and client
> > replay to this
> > > 2) this server receive  500 msg per second from
> client
> > and replay to
> > > client
> > >
> > > as result server send and receive 2000 msg/sec .
> > > After one day system throw outofmemory exception
> and
> > server is down.
> > > my heap size is 2Gige.
> > >
> > > what is your solution to this problem?
> > > Do you check my source If i send this to forum ?
> > >
> > >
> > >


      

Re: AW: problem:outof memory error

Posted by Maziyar Eslamieh <ma...@yahoo.com>.
os=linux                      
ram 2GB
jvm version=sun-1.6.03         
jvm parameters=-server -Xms1600M -Xmx1600M  -XX:UseParallelGC


I send the source and diagram  of my project to resolve OOM Exception .
 
my problem  :
1- send and receive 100 message per second  from 6 client as   server side  2-send and receive 100 message per second  from 6 server as client side 
you can see my  network topology  from image

i am using ExecuteFilter to create dedicated thread model  to handle sessions
  my program works normally  for one day  then i  get OOM Exception. 


--- On Fri, 6/13/08, Steve Ulrich <st...@proemion.com> wrote:

> From: Steve Ulrich <st...@proemion.com>
> Subject: AW: problem:outof memory error
> To: "dev@mina.apache.org" <de...@mina.apache.org>, "maeslamieh@yahoo.com" <ma...@yahoo.com>
> Date: Friday, June 13, 2008, 11:22 AM
> Hi!
> Are you doing anything else than plain text decoding? Maybe
> there's a leak somewhere at your code, or maybe it takes
> too long to execute your code, so the received message pile
> up while your code is executed.
> To prevent the latter one, you can use an ExecutorFilter
> (put behind the Decoder) to separate the long running
> operations from the receiver/decoder and get a better
> scalability.
> If nothing helps: Try a profiler!
> 
> hth
> 
> Steve
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Maziyar Eslamieh [mailto:maeslamieh@yahoo.com]
> > Gesendet: Donnerstag, 12. Juni 2008 18:16
> > An: Forum MINA
> > Betreff: problem:outof memory error
> >
> > Hi all
> > Can you help me?
> > I am using MINA2 in my messaging system.
> > This system is a server that send and receive text
> message.
> > I use this filter in my server:
> >    acceptor.getFilterChain().addLast(
> >                 "codec",
> >                 new ProtocolCodecFilter(new
> > TextLineCodecFactory(Charset
> >                        
> .forName("UTF-8"))));
> >
> > I have two scenario:
> > 1) this server send 500 msg per second and client
> replay to this
> > 2) this server receive  500 msg per second from client
> and replay to
> > client
> >
> > as result server send and receive 2000 msg/sec .
> > After one day system throw outofmemory exception and
> server is down.
> > my heap size is 2Gige.
> >
> > what is your solution to this problem?
> > Do you check my source If i send this to forum ?
> >
> >
> >


      

AW: problem:outof memory error

Posted by Steve Ulrich <st...@proemion.com>.
Hi!
Are you doing anything else than plain text decoding? Maybe there's a leak somewhere at your code, or maybe it takes too long to execute your code, so the received message pile up while your code is executed.
To prevent the latter one, you can use an ExecutorFilter (put behind the Decoder) to separate the long running operations from the receiver/decoder and get a better scalability.
If nothing helps: Try a profiler!

hth

Steve

> -----Ursprüngliche Nachricht-----
> Von: Maziyar Eslamieh [mailto:maeslamieh@yahoo.com]
> Gesendet: Donnerstag, 12. Juni 2008 18:16
> An: Forum MINA
> Betreff: problem:outof memory error
>
> Hi all
> Can you help me?
> I am using MINA2 in my messaging system.
> This system is a server that send and receive text message.
> I use this filter in my server:
>    acceptor.getFilterChain().addLast(
>                 "codec",
>                 new ProtocolCodecFilter(new
> TextLineCodecFactory(Charset
>                         .forName("UTF-8"))));
>
> I have two scenario:
> 1) this server send 500 msg per second and client replay to this
> 2) this server receive  500 msg per second from client and replay to
> client
>
> as result server send and receive 2000 msg/sec .
> After one day system throw outofmemory exception and server is down.
> my heap size is 2Gige.
>
> what is your solution to this problem?
> Do you check my source If i send this to forum ?
>
>
>


Re: problem:outof memory error

Posted by Steve Johns <st...@gmail.com>.
OOM was caused by a lot of reasons. Some hints: either READ or WRITE can't
handle the message. The message itself is too BIG. Tuning your GC.

On Fri, Jun 13, 2008 at 12:16 AM, Maziyar Eslamieh <ma...@yahoo.com>
wrote:

> Hi all
> Can you help me?
> I am using MINA2 in my messaging system.
> This system is a server that send and receive text message.
> I use this filter in my server:
>   acceptor.getFilterChain().addLast(
>                "codec",
>                new ProtocolCodecFilter(new TextLineCodecFactory(Charset
>                        .forName("UTF-8"))));
>
> I have two scenario:
> 1) this server send 500 msg per second and client replay to this
> 2) this server receive  500 msg per second from client and replay to client
>
> as result server send and receive 2000 msg/sec .
> After one day system throw outofmemory exception and server is down.
> my heap size is 2Gige.
>
> what is your solution to this problem?
> Do you check my source If i send this to forum ?
>
>
>
>
>