You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Kaspar Luethi <ka...@humantools.com> on 2006/01/11 00:29:18 UTC

Re: [MINA] Apparent DEADLOCK in com.mchange.v2.async.ThreadPoolAsynchronousRunner

hi alessandro

2500 users sounds good. were they also sending actual data and
it being broacasted to all other users?

i think this is a memory problem and not a deadlock case.
deadlocks can occurr easily, when objects cannot be created
due to memory shortage and somecode is waiting for it...

with 2500 users you likely also have more than 2500 mina ByteBuffers
in memory, eventually a multiple of that. now it depends how big those
buffers are...2KB? 20MB?! maybe your mac just has not enough RAM :)

so you should watch the memory consumption while stress testing.
do you have something like the "top" command on OS X? it helps too
for watching the cpu load.

try to give your JVM more memory. at first you could try the -server
switch, which does allow the JVM to allocate more memory by default
along with some other differences in the JRE and garbage collection.
i don't know if apple's java implementation has this option.

for the sun JVM there is a list of options (many for solaris only) at
http://java.sun.com/docs/hotspot/VMOptions.html

kaspar


Alessandro Torrisi wrote:
> Hi ! Yesterday I put in stress my direct connect hub software on Mac
> Os X 10.3.4 Tiger with latest Java implementation.
> Max fake users reached number is 2500. When I reached this number the
> application has thrown this exception:
>
> Exception in thread "IoThreadPool-1" java.lang.OutOfMemoryError: Java
> heap space
> Exception in thread "IoThreadPool-4" java.lang.OutOfMemoryError: Java
> heap space
> com.mchange.v2.async.ThreadPoolAsynchronousRunner
> $DeadlockDetector@27d98b -- APPARENT DEADLOCK!!! Creating emergency
> threads for unassigned pending tasks!
> Exception in thread "IoThreadPool-3" java.lang.OutOfMemoryError: Java
> heap space
> Exception in thread "Timer-0" java.lang.OutOfMemoryError: Java heap
> space
> 4212917 [SocketAcceptor-0] WARN
> org.apache.mina.common.support.DefaultExceptionMonitor - Unexpected
> exception.
> java.lang.OutOfMemoryError: Java heap space
> Exception in thread "IoThreadPool-2" java.lang.OutOfMemoryError: Java
> heap space
>
> What's this ? Is it directly caused by the Java heap space ? How can
> I avoid it ?
> Thanks and best regards,
>
> Alessandro Torrisi
>
> http://www.alessandrotorrisi.it
>



Re: [MINA] Apparent DEADLOCK in com.mchange.v2.async.ThreadPoolAsynchronousRunner

Posted by Emmanuel Lecharny <el...@gmail.com>.
Alessandro Torrisi a écrit :

> I used top to monitor application, but it's too expensive:


Just try with vmstat. It's less expensive, I think

>
> with 1581 users I have 312 Mb in memory and a cpu usage between the  
> 6% and the 20%
> as average.
>
that's not too much. Do you still have the pb with 2500 users ?

--Emmanuel Lécharny

Re: [MINA] Apparent DEADLOCK in com.mchange.v2.async.ThreadPoolAsynchronousRunner

Posted by Alessandro Torrisi <al...@eurone.it>.
Now I'm using -Xms32M and -Xmx1024M and it looks better, but code  
could be optimized.
If someone wants too look the code or access cvs tell me please.

I used top to monitor application, but it's too expensive:

with 1581 users I have 312 Mb in memory and a cpu usage between the  
6% and the 20%
as average.

My buffers are of 2048 bytes, are enough ? Is it too much ?

Bye, Alex :D


On 11/gen/06, at 00:29, Kaspar Luethi wrote:

> hi alessandro
>
> 2500 users sounds good. were they also sending actual data and
> it being broacasted to all other users?
>
> i think this is a memory problem and not a deadlock case.
> deadlocks can occurr easily, when objects cannot be created
> due to memory shortage and somecode is waiting for it...
>
> with 2500 users you likely also have more than 2500 mina ByteBuffers
> in memory, eventually a multiple of that. now it depends how big those
> buffers are...2KB? 20MB?! maybe your mac just has not enough RAM :)
>
> so you should watch the memory consumption while stress testing.
> do you have something like the "top" command on OS X? it helps too
> for watching the cpu load.
>
> try to give your JVM more memory. at first you could try the -server
> switch, which does allow the JVM to allocate more memory by default
> along with some other differences in the JRE and garbage collection.
> i don't know if apple's java implementation has this option.
>
> for the sun JVM there is a list of options (many for solaris only) at
> http://java.sun.com/docs/hotspot/VMOptions.html
>
> kaspar
>
>
> Alessandro Torrisi wrote:
>> Hi ! Yesterday I put in stress my direct connect hub software on Mac
>> Os X 10.3.4 Tiger with latest Java implementation.
>> Max fake users reached number is 2500. When I reached this number the
>> application has thrown this exception:
>>
>> Exception in thread "IoThreadPool-1" java.lang.OutOfMemoryError: Java
>> heap space
>> Exception in thread "IoThreadPool-4" java.lang.OutOfMemoryError: Java
>> heap space
>> com.mchange.v2.async.ThreadPoolAsynchronousRunner
>> $DeadlockDetector@27d98b -- APPARENT DEADLOCK!!! Creating emergency
>> threads for unassigned pending tasks!
>> Exception in thread "IoThreadPool-3" java.lang.OutOfMemoryError: Java
>> heap space
>> Exception in thread "Timer-0" java.lang.OutOfMemoryError: Java heap
>> space
>> 4212917 [SocketAcceptor-0] WARN
>> org.apache.mina.common.support.DefaultExceptionMonitor - Unexpected
>> exception.
>> java.lang.OutOfMemoryError: Java heap space
>> Exception in thread "IoThreadPool-2" java.lang.OutOfMemoryError: Java
>> heap space
>>
>> What's this ? Is it directly caused by the Java heap space ? How can
>> I avoid it ?
>> Thanks and best regards,
>>
>> Alessandro Torrisi
>>
>> http://www.alessandrotorrisi.it
>>
>
>