You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jeffrey <je...@hotmail.com> on 2013/02/05 21:08:44 UTC

java.lang.OutOfMemoryError: unable to create new native thread

We are using Fuse esb 7.0.2 for a broker right now and testing it to see if
it can work for out production environment.
Everytime I get to about 700 connections to the broker, I get this
exception:
 Exception in thread "InactivityMonitor WriteCheck"
java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:640)
        at
java.util.concurrent.ThreadPoolExecutor.addIfUnderMaximumPoolSize(ThreadPoolExecutor.java:727)
        at
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:657)
        at
org.apache.activemq.transport.AbstractInactivityMonitor.writeCheck(AbstractInactivityMonitor.java:142)
        at
org.apache.activemq.transport.AbstractInactivityMonitor$2.run(AbstractInactivityMonitor.java:111)
        at
org.apache.activemq.thread.SchedulerTimerTask.run(SchedulerTimerTask.java:33)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)

I looked at
http://www.commonsensecode.com/2010/07/02/activemq-supporting-thousands-of-concurrent-connections/
and http://www.pepperdust.org/?p=150 and tried some of their ideas.  I
changed to nio+ssl instead of the regular ssl (If we cant use ssl we cant
use it at all).  I tried changing my systemUsage memory amount to high
values and to low values.  I have done it with and without producer flow
control. Still at about 700 connections the exception happens and
disconnects most, if not all of my clients, and will not allow any new
clients to connect either.

I also removed some other processes from the server machine to make sure
there was pleanty of memory space for it, and also changed my clients to not
actually send anything, just make a connection and hold it.  Even with this
it still breaks at 700 connections and 0 messages for being out of memory.

I know ESB 7.0.2 does not contain the latest version of ActiveMQ but I
cannot change this easily.  Is there any other information or ideas to help
avoid this problem and get a large number of connections?

Thanks



--
View this message in context: http://activemq.2283324.n4.nabble.com/java-lang-OutOfMemoryError-unable-to-create-new-native-thread-tp4662804.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: java.lang.OutOfMemoryError: unable to create new native thread

Posted by jeffrey <je...@hotmail.com>.
specifying a 64bit jvm with -d64 seemed to do the trick, It has been running
for 18 hours and hasn't claimed it was running out of memory yet, so we'll
see how it goes.



--
View this message in context: http://activemq.2283324.n4.nabble.com/java-lang-OutOfMemoryError-unable-to-create-new-native-thread-tp4662804p4662979.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: java.lang.OutOfMemoryError: unable to create new native thread

Posted by jeffrey <je...@hotmail.com>.
I tried using the -Xms and -Xmx options to see of that would help
Xms at 1024M and Xmx at 2048M.
This did help and my server is much more stable, but the options don't seem
to be working quite as expected.  Currently my process is showing 
                                 User      CPU %       Thrd  Disk         
Memory         Block
Process Name     PID     Name   ( 100% max) Cnt   IOrate       RSS/VSS      
On
java                  28108   root         10.0      1253   4.2      1.19gb  
3.08gb  SLEEP

So the memory is above 3 GB, I though I set a maximum of 2GB for the JVM,
does it not actally work that way?

....
As I was typing this, I got another throw of the OutOfMemoryError exception
after having ~1150 connection working fine for a few hours.

So even this size of JVM doesnt fix the problem



--
View this message in context: http://activemq.2283324.n4.nabble.com/java-lang-OutOfMemoryError-unable-to-create-new-native-thread-tp4662804p4662898.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: java.lang.OutOfMemoryError: unable to create new native thread

Posted by mikmela <mi...@yahoo.com>.
Have you tried -Dorg.apache.activemq.UseDedicatedTaskRunner=false
http://activemq.apache.org/how-do-i-configure-10s-of-1000s-of-queues-in-a-single-broker-.html
<http://activemq.apache.org/how-do-i-configure-10s-of-1000s-of-queues-in-a-single-broker-.html>  



--
View this message in context: http://activemq.2283324.n4.nabble.com/java-lang-OutOfMemoryError-unable-to-create-new-native-thread-tp4662804p4663366.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.