activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jockeyyan <jockey...@gmail.com>
Subject Re: ActiveMQ Broker Scheduler unable to create new native thread
Date Thu, 27 Sep 2012 12:33:46 GMT
As you know, I guess it reached the limitation of thread count, and it's no
use to increase the memory for broker.

闫继培 Jockey Yan
在 2012-9-27 PM6:23,"Gaurav Sharma [via ActiveMQ]" <
ml-node+s2283324n4657081h74@n4.nabble.com>写道:

> Your memoryUsage limit is only 256megs; bump it up. Some more pointers
> here: http://activemq.apache.org/javalangoutofmemory.html
>
> On Thu, Sep 27, 2012 at 3:11 AM, jockeyyan <[hidden email]<http://user/SendEmail.jtp?type=node&node=4657081&i=0>>
> wrote:
>
> > Hi Gaurav:
> >
> > It seems the ActiveMQ is not stable, from 5.4.3 to 5.6.0, and I tried
> > many times, and it always throw "unable to create new create native
> > thread", Does anyone know how to solve it?
> >
> > my AMQ configuratoin of activemq.xml as following:
> >
> ---------------------------------------------------------------------------------
>
> > <!--
> >     Licensed to the Apache Software Foundation (ASF) under one or more
> >     contributor license agreements.  See the NOTICE file distributed
> with
> >     this work for additional information regarding copyright ownership.
> >     The ASF licenses this file to You under the Apache License, Version
> 2.0
> >     (the "License"); you may not use this file except in compliance with
> >     the License.  You may obtain a copy of the License at
> >
> >     http://www.apache.org/licenses/LICENSE-2.0
> >
> >     Unless required by applicable law or agreed to in writing, software
> >     distributed under the License is distributed on an "AS IS" BASIS,
> >     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> >     See the License for the specific language governing permissions and
> >     limitations under the License.
> > -->
> > <!-- START SNIPPET: example -->
> > <beans
> >   xmlns="http://www.springframework.org/schema/beans"
> >   xmlns:amq="http://activemq.apache.org/schema/core"
> >   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >   xsi:schemaLocation="http://www.springframework.org/schema/beans
> > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> >   http://activemq.apache.org/schema/core
> > http://activemq.apache.org/schema/core/activemq-core.xsd">
> >
> >     <!-- Allows us to use system properties as variables in this
> > configuration file -->
> >     <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>
> >         <property name="locations">
> >
> <value>file:${activemq.base}/conf/credentials.properties</value>
> >         </property>
> >     </bean>
> >
> >     <!--
> >         The <broker> element is used to configure the ActiveMQ broker.
> >     -->
> >     <broker xmlns="http://activemq.apache.org/schema/core"
> > brokerName="localhost" dataDirectory="${activemq.base}/data"
> >         persistent="true" destroyApplicationContextOnStop="true">
> >
> >         <!--
> >                         For better performances use VM cursor and small
> memory limit.
> >                         For more information, see:
> >
> >             http://activemq.apache.org/message-cursors.html
> >
> >             Also, if your producer is "hanging", it's probably due to
> > producer flow control.
> >             For more information, see:
> >             http://activemq.apache.org/producer-flow-control.html
> >         -->
> >
> >         <destinationPolicy>
> >             <policyMap>
> >               <policyEntries>
> >                 <policyEntry topic=">" producerFlowControl="false"
> > memoryLimit="16mb">
> >                   <pendingSubscriberPolicy>
> >                     <vmCursor />
> >                     <!--fileCursor /-->
> >                   </pendingSubscriberPolicy>
> >                 </policyEntry>
> >                 <policyEntry queue=">" producerFlowControl="false"
> > memoryLimit="16mb">
> >                   <!-- Use VM cursor for better latency
> >                        For more information, see:
> >
> >                        http://activemq.apache.org/message-cursors.html
> >
> >                   -->
> >                   <pendingQueuePolicy>
> >                     <vmQueueCursor/>
> >                     <!--fileQueueCursor/-->
> >                   </pendingQueuePolicy>
> >                 </policyEntry>
> >               </policyEntries>
> >             </policyMap>
> >         </destinationPolicy>
> >
> >         <!--
> >             The managementContext is used to configure how ActiveMQ is
> > exposed in
> >             JMX. By default, ActiveMQ uses the MBean server that is
> started by
> >             the JVM. For more information, see:
> >
> >             http://activemq.apache.org/jmx.html
> >         -->
> >         <managementContext>
> >             <managementContext createConnector="false"/>
> >         </managementContext>
> >
> >                                 <networkConnectors>
> >                                         <networkConnector name="bridge"
> >                                                 uri="static:(nio://
> 192.168.128.184:61616)"
> >                                                 duplex="true" />
> >                                 </networkConnectors>
> >
> >         <!--
> >             Configure message persistence for the broker. The default
> > persistence
> >             mechanism is the KahaDB store (identified by the kahaDB
> tag).
> >             For more information, see:
> >
> >             http://activemq.apache.org/persistence.html
> >         -->
> >         <persistenceAdapter>
> >             <kahaDB directory="${activemq.base}/data/kahadb"/>
> >         </persistenceAdapter>
> >
> >
> >           <!--
> >             The systemUsage controls the maximum amount of space the
> > broker will
> >             use before slowing down producers. For more information,
> see:
> >
> >             http://activemq.apache.org/producer-flow-control.html
> >                 -->
> >
> >         <systemUsage>
> >             <systemUsage>
> >                 <memoryUsage>
> >                     <memoryUsage limit="256 mb"/>
> >                 </memoryUsage>
> >                 <storeUsage>
> >                     <storeUsage limit="1 gb"/>
> >                 </storeUsage>
> >                 <tempUsage>
> >                     <tempUsage limit="512 mb"/>
> >                 </tempUsage>
> >             </systemUsage>
> >         </systemUsage>
> >
> >         <!--
> >             The transport connectors expose ActiveMQ over a given
> protocol to
> >             clients and other brokers. For more information, see:
> >
> >             http://activemq.apache.org/configuring-transports.html
> >         -->
> >                                 <transportConnectors>
> >                                         <transportConnector
> name="local-listening"
> >                                                 uri="nio://0.0.0.0:62626"
> />
> >                                 </transportConnectors>
> >
> >     </broker>
> >
> >     <!--
> >         Enable web consoles, REST and Ajax APIs and demos
> >
> >         Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
> >     -->
> >     <import resource="jetty.xml"/>
> >
> > </beans>
> > <!-- END SNIPPET: example -->
> >
> ------------------------------------------------------------------------------------------------------------
>
> >
> >
> > Very urgent, thanks!
> >
> >
> > 2012/9/22 Gaurav Sharma [via ActiveMQ]
> > <[hidden email] <http://user/SendEmail.jtp?type=node&node=4657081&i=1>>:
>
> >> For starters, simply give it more heap. So, increase heap as a step
> function
> >> (1G, 1.5G, 2G...) and measure throughput. Throughput sustenance will
> also
> >> depend on message size and how well both the broker and clients keep
> up.
> >>
> >> On Sep 21, 2012, at 18:49, jockeyyan <[hidden email]> wrote:
> >>
> >>> Dear Gaurav:
> >>>
> >>> The configuration parameters of my broker as following:
> >>>
> >>>
> ---------------------------------------------------------------------------------------------------
>
> >>> ACTIVEMQ_OPTS=-Xmx512M
> >>> -Dorg.apache.activemq.UseDedicatedTaskRunner=false
> >>> -Djava.util.logging.config.file=logging.properties -Xss256k
> >>>
> >>>
> ---------------------------------------------------------------------------------------------------
>
> >>> There are 1 CPU of 4 kernels and 6G memory on this machine, and no
> >>> other app is running.
> >>>
> >>>
> >>> 2012/9/21 Gaurav Sharma [via ActiveMQ]
> >>> <[hidden email]>:
> >>>> How much heap have we given to the broker and what else is running on
> the
> >>>> same machine? Also, just fire up jconsole, attach to the process and
> >>>> watch
> >>>> allocations, threads and cpu - should give a clue. v5.6 is the
> current
> >>>> release, so, upgrade if possible.
> >>>>
> >>>> On Sep 20, 2012, at 23:34, jockeyyan <[hidden email]> wrote:
> >>>>
> >>>>> Hi:
> >>>>>
> >>>>> I am using ActiveMQ 5.4.3 to make some loading test. I created one
> >>>>> producer,
> >>>>> one broker and one consumer with Spring JAX-WS config. The producer
> >>>>> invoke
> >>>>> the functions to send messages to broker continuously and the
> consumer
> >>>>> just
> >>>>> receive and echo.
> >>>>> Everything is OK at beginning. After invoke many times(about 2000
to
> >>>>> 3000),
> >>>>> the broker is crashed and display the following error message, Does
> >>>>> anyone
> >>>>> could help me fingure out what the matter of the broker is?
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> --------------------------------------------------------------------------------------------------
>
> >>>>> Exception in thread "ActiveMQ Broker[localhost] Scheduler"
> >>>>> java.lang.OutOfMemory
> >>>>> Error: 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(Thr
> >>>>> eadPoolExecutor.java:727)
> >>>>>       at
> >>>>>
> java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.ja
> >>>>> va:657)
> >>>>>       at
> >>>>>
> org.apache.activemq.thread.PooledTaskRunner.wakeup(PooledTaskRunner.j
> >>>>> ava:76)
> >>>>>       at
> >>>>> org.apache.activemq.broker.region.Queue.asyncWakeup(Queue.java:1637)
> >>>>>       at
> >>>>>
> org.apache.activemq.broker.region.Queue.expireMessages(Queue.java:773
> >>>>> )
> >>>>>       at
> >>>>> org.apache.activemq.broker.region.Queue.access$100(Queue.java:83)
> >>>>>       at
> org.apache.activemq.broker.region.Queue$2.run(Queue.java:123)
> >>>>>       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)
> >>>>>
> >>>>>
> >>>>>
> --------------------------------------------------------------------------------------------------
>
> >>>>>
> >>>>> The config of my consumer as following:
> >>>>>
> >>>>>
> >>>>>
> --------------------------------------------------------------------------------------------------
>
> >>>>> <bean id="jmsConnectionFactory"
> >>>>> class="org.springframework.jms.connection.CachingConnectionFactory">
> >>>>>   <property name="targetConnectionFactory">
> >>>>>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
> >>>>>           <property name="brokerURL" value="tcp://localhost:61616"
> />
> >>>>>       </bean>
> >>>>>   </property>
> >>>>>   <property name="sessionCacheSize" value="50" />
> >>>>> </bean>
> >>>>>
> >>>>> <bean id="jmsConfig"
> >>>>> class="org.apache.cxf.transport.jms.JMSConfiguration"
> >>>>>   p:connectionFactory-ref="jmsConnectionFactory"
> >>>>>   p:targetDestination="test.queue"
> >>>>> />
> >>>>>
> >>>>>
> >>>>>   <jaxws:endpoint xmlns:customer="
> http://customerservice.example.com/"
> >>>>>       id="CustomerServiceHTTP" address="jms://"
> >>>>>
> >>>>>
> implementor="com.example.customerservice.server.CustomerServiceImpl">
> >>>>>       <jaxws:features>
> >>>>>           <bean class="org.apache.cxf.feature.LoggingFeature"
/>
> >>>>>           <bean
> class="org.apache.cxf.transport.jms.JMSConfigFeature"
> >>>>> p:jmsConfig-ref="jmsConfig" />
> >>>>>       </jaxws:features>
> >>>>>   </jaxws:endpoint>
> >>>>>
> >>>>>
> >>>>>
> --------------------------------------------------------------------------------------------------
>
> >>>>>
> >>>>> The config of my producer as following:
> >>>>>
> >>>>>
> >>>>>
> --------------------------------------------------------------------------------------------------
>
> >>>>> <bean id="jmsConnectionFactory"
> >>>>> class="org.springframework.jms.connection.SingleConnectionFactory">
> >>>>>   <property name="targetConnectionFactory">
> >>>>>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
> >>>>>           <property name="brokerURL" value="tcp://localhost:61616"
> />
> >>>>>       </bean>
> >>>>>   </property>
> >>>>> </bean>
> >>>>>
> >>>>> <bean id="jmsConfig"
> >>>>> class="org.apache.cxf.transport.jms.JMSConfiguration"
> >>>>>   p:connectionFactory-ref="jmsConnectionFactory"
> >>>>>   p:targetDestination="test.queue"
> >>>>> />
> >>>>>
> >>>>>   <jaxws:client id="customerService"
> >>>>>       address="jms://"
> >>>>>       serviceClass="com.example.customerservice.CustomerService">
> >>>>>       <jaxws:features>
> >>>>>           <bean class="org.apache.cxf.feature.LoggingFeature"
/>
> >>>>>           <bean
> class="org.apache.cxf.transport.jms.JMSConfigFeature"
> >>>>> p:jmsConfig-ref="jmsConfig" />
> >>>>>       </jaxws:features>
> >>>>>   </jaxws:client>
> >>>>>
> >>>>>
> >>>>>
> --------------------------------------------------------------------------------------------------
>
> >>>>>
> >>>>> Jockey Yan
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> View this message in context:
> >>>>>
> >>>>>
> http://activemq.2283324.n4.nabble.com/ActiveMQ-Broker-Scheduler-unable-to-create-new-native-thread-tp4656787.html
> >>>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>>>
> >>>>
> >>>> ________________________________
> >>>> If you reply to this email, your message will be added to the
> discussion
> >>>> below:
> >>>>
> >>>>
> http://activemq.2283324.n4.nabble.com/ActiveMQ-Broker-Scheduler-unable-to-create-new-native-thread-tp4656787p4656820.html
> >>>> To unsubscribe from ActiveMQ Broker Scheduler unable to create new
> native
> >>>> thread, click here.
> >>>> NAML
> >>>
> >>>
> >>>
> >>> --
> >>> 闫继培
> >>> Jockey Yan
> >>>
> >>> Email: [hidden email]
> >>> Mobile: 13601186611
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://activemq.2283324.n4.nabble.com/ActiveMQ-Broker-Scheduler-unable-to-create-new-native-thread-tp4656787p4656827.html
> >>
> >>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>
> >>
> >> ________________________________
> >> If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> http://activemq.2283324.n4.nabble.com/ActiveMQ-Broker-Scheduler-unable-to-create-new-native-thread-tp4656787p4656828.html
> >> To unsubscribe from ActiveMQ Broker Scheduler unable to create new
> native
> >> thread, click here.
> >> NAML
> >
> >
> >
> > --
> > 闫继培
> > Jockey Yan
> >
> > Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=4657081&i=2>
> > Mobile: 13601186611
> >
> >
> >
> >
> > --
> > View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-Broker-Scheduler-unable-to-create-new-native-thread-tp4656787p4657080.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://activemq.2283324.n4.nabble.com/ActiveMQ-Broker-Scheduler-unable-to-create-new-native-thread-tp4656787p4657081.html
>  To start a new topic under ActiveMQ - User, email
> ml-node+s2283324n2341805h18@n4.nabble.com
> To unsubscribe from ActiveMQ Broker Scheduler unable to create new native
> thread, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656787&code=am9ja2V5eWFuQGdtYWlsLmNvbXw0NjU2Nzg3fDEwMjY2NTUwNzg=>
> .
> NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Broker-Scheduler-unable-to-create-new-native-thread-tp4656787p4657095.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message