Results 1 to 5 of 5

Thread: too many open files - using JMSTemplate

  1. #1
    Join Date
    Nov 2008
    Posts
    3

    Default too many open files - using JMSTemplate

    I'm using Spring's JMSTemplate with ActiveMQ to publish messages into topics. My web service is Java SE Deployment with EndPoint. Once quotes are created or updated, my application publishes those quotes into topics. After publishing around 500+ messages, my application hungs as lsof on solaris box shows 1023 files already opened. Limitation on solaris box is 1024. Incrementing number of files can be opened, using 'ulimit' is not an option.

    I'm using PooledConnectionFactory to pool JMS connection provider.

    The following are my configuration on spring.xml:

    <bean class="org.springframework.aop.framework.autoproxy .DefaultAdvisorAutoProxyCreator" >
    <property name="proxyTargetClass" value="true"/>
    </bean>

    <bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFa ctory" destroy-method="stop">
    <property name="connectionFactory">
    <bean class="org.apache.activemq.ActiveMQConnectionFacto ry">
    <property name="brokerURL">
    <value>tcp://someurl:61616</value>
    </property>
    </bean>
    </property>
    </bean>

    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="jmsFactory" />
    <property name="pubSubDomain" value="true" />
    <property name="deliveryMode" value="1" />
    </bean>

    <bean id="gbRegularUpdateTopic" class="org.apache.activemq.command.ActiveMQTopic">
    <constructor-arg index="0" value="grainbid.regular.update.topic" />
    </bean>

    <bean id="gbRegularUpdateJmsGateway" class="com.gb.jms.activemq.impl.GrainBidReportJmsG atewayImpl">
    <property name="jmsTemplate" ref="jmsTemplate" />
    <property name="destination" ref="gbRegularUpdateTopic"/>
    </bean>

    GrainBidReportJmsGatewayImpl uses spring's jmsTemplate.send(destination, MessageCreator) method to publish messages and messages are published into topics fine.

    The following are my activeMQ.xml:

    <broker useJmx="true" brokerName="color-app-dev.broker" dataDirectory="/data/activemq/data">

    <destinations>
    <topic physicalName="grainbid.regular.update.topic"/>
    </destinations>

    <destinationPolicy>
    <policyMap>
    <policyEntries>
    <policyEntry queue=">" memoryLimit="5mb"/>
    <policyEntry topic=">" memoryLimit="5mb"/>
    </policyEntries>
    </policyMap>
    </destinationPolicy>

    <persistenceAdapter>
    <jdbcPersistenceAdapter dataDirectory="/data/activemq/data" dataSource="#oracle-ds" useDatabaseLock="true">
    <statements>
    <statements messageTableName="TAB_GB_ACTIVEMQ_MSGS" durableSubAcksTableName="TAB_GB_ACTIVEMQ_ACKS" lockTableName="TAB_GB_ACTIVEMQ_LOCK"/>
    </statements>
    </jdbcPersistenceAdapter>
    </persistenceAdapter>
    </broker>

    What am I doing wrong? Please help me find out why are those files are not closed.

  2. #2
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default

    Quote Originally Posted by rkhadka View Post
    After publishing around 500+ messages, my application hungs as lsof on solaris box shows 1023 files already opened. Limitation on solaris box is 1024. Incrementing number of files can be opened, using 'ulimit' is not an option
    1k file handles is way too low for a server application.

    http://docs.sun.com/source/817-5051/pt_tuningos.html

    Edit: BTW, you may want to do a netstat -a -tcp to see if you have any sockets open that aren't getting closed immediately. That is probably eating up your FD's.
    Last edited by chudak; Nov 20th, 2008 at 03:57 PM.

  3. #3
    Join Date
    Aug 2004
    Location
    Sydney
    Posts
    503

    Default

    There are quite a few bugs in ActiveMQ, incl. several about not closing files. Which version are you using?

  4. #4
    Join Date
    Nov 2008
    Posts
    3

    Default

    I'm using 5.1. Regarding chudak's response, increasing files handles is not an option. I did the lsof and showed way too many FIFO and VCHR. TCP sockets are closed properly. I'm not running on app server other than java se 6 with jax-ws. I would appreciate any help.
    Last edited by rkhadka; Nov 21st, 2008 at 07:27 AM.

  5. #5
    Join Date
    Nov 2008
    Posts
    3

    Default

    Still waiting for some suggestions. Anybody???

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •