You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Steve Ulrich <st...@proemion.com> on 2008/04/28 11:51:14 UTC

AW: [SPAMCheck] Re: AW: why ConcurrentLinkedQueue$node is wipe off from momory by garbage collection? no---signature

Oh, you're right. Additionally I just noticed, that you're talking about the output of messages.
For me, it looks like the ConcurrentLinkedQueue is taking things too fast, while a PriorityBlockingQueue is slowing down the whole process because of it's (b)locking synchronisation method. I don't think that the problem is solved, but just pushed to a higher thread count and maybe results in a lower message throughput.
Try to find a way to slow down your write mechanism and, if possible, bulk write messages for a session and you will have a similar effect but without the negatives.

regards from Germany

Steve Ulrich

-----Ursprüngliche Nachricht-----
Von: Maziyar Eslamieh [mailto:maeslamieh@yahoo.com]
Gesendet: Montag, 28. April 2008 10:42
An: dev@mina.apache.org
Betreff: [SPAMCheck] Re: AW: why ConcurrentLinkedQueue$node is wipe off from momory by garbage collection? no---signature
Wichtigkeit: Niedrig


PriorityBlockingQueue is Thread-safe and unbounded .if this queue isn't unbound then throw an exception.
http://java.sun.com/javase/6/docs/api/java/util/PriorityQueue.html
http://java.sun.com/javase/6/docs/api/java/util/concurrent/PriorityBlockingQueue.html

--- On Mon, 4/28/08, Steve Ulrich <st...@proemion.com> wrote:

> From: Steve Ulrich <st...@proemion.com>
> Subject: AW: why ConcurrentLinkedQueue$node is wipe off from momory by garbage collection? no---signature
> To: "dev@mina.apache.org" <de...@mina.apache.org>, "maeslamieh@yahoo.com" <ma...@yahoo.com>
> Date: Monday, April 28, 2008, 11:52 AM
> Hi!
>
> You're replacing the ConcurrentLinkedQueue (a
> nonblocking, thread safe queue) with a a blocking (but NOT
> thread safe) queue. So there may be some unpredictable
> results and I wouldn't do that.
>
> As Emmanuel pointed out, it is likely that your server
> can't process mass of incomming messages. Try to
> configure a proper thread model (Add an ExecutorFilter at
> you filter chain, to loosen your long running processings
> from the IO threads) and carefully read the overload
> prevention posts at mailing list archives. This should help
> to prevent this situations.
>
> hth
>
> Steve Ulrich
>
> -----Ursprüngliche Nachricht-----
> Von: Maziyar Eslamieh [mailto:maeslamieh@yahoo.com]
> Gesendet: Montag, 28. April 2008 08:04
> An: dev@mina.apache.org
> Betreff: Re: why ConcurrentLinkedQueue$node is wipe off
> from momory by garbage collection?
>
> I mean that why doesn't garbage collector throw out of
> memory.
> I have a solution for this problem please pay attention to
> this solution because of this problem is very important:
> In ConcurrentLinkedQueue  when a object insert to this
> queue an object of Node class is created and object insert
> to this Node object.
> In MINA2 in AbstractPollingIoProcessor class where flush()
> method call
>  T session = flushingSessions.poll();
> object is removed  from queue but garbage collector
> can't throw out object of Node class from memory
> specially when about 600 message per second have to send
> and received by MINA2.
> So for this problem i replace PriorityBlockingQueue instead
> of ConcurrentLinkedQueue  .
> I test this and operation Mina2 is correct
> I want to ask that this change is true or not.
> please answer to me.
>
>
> In MINA2 in AbstractPollingIoProcessor class where
> private final Queue<T> flushingSessions =new
> ConcurrentLinkedQueue<T>(); instead of
> ConcurrentLinkedQueue
>
>
> --- On Sun, 4/27/08, Maziyar Eslamieh
> <ma...@yahoo.com> wrote:
>
> > From: Maziyar Eslamieh <ma...@yahoo.com>
> > Subject: why ConcurrentLinkedQueue$node is wipe off
> from momory by garbage collection?
> > To: dev@mina.apache.org
> > Date: Sunday, April 27, 2008, 10:21 AM
> > please help me
> >
> > We have a sender and receiver server which uses MINA2.
> We
> > should send and receiver 600 message per second. As
> this
> > server receives messages , the number of
> > ConcurrentLinkedQueue$node object increases in memory.
> > I want to know why the number of this object increases
> and
> > why it is wipe off from momory by garbage collection?
> >
> >
> >
> >
> ____________________________________________________________________________________
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile.  Try it now.
> >
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
>
>
> ____________________________________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ