activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully" <gary.tu...@gmail.com>
Subject Re: memory leak problem with ActiveMQ 5.1
Date Wed, 19 Nov 2008 15:22:47 GMT
It is probably best to open a jira issue and submit a Junit test case
of your client that demonstrates the out of memory error.

2008/11/19 Elihu Smails <elihusmails@gmail.com>:
> I am finally getting the chance to continue testing this and am still
> getting OutOfMemory errors on the JVM that is sending messages to the
> ActiveMQ server.  I have set the policy to
> <noSubscriptionRecoveryPolicy/> on the ActiveMQ server using the
> latest code in the trunk.
>
> Anyone have any more ideas on how to prevent these OutOfMemory errors.
>
> Thanks
>
> On Thu, Oct 9, 2008 at 7:55 PM, Mark Webb <elihusmails@gmail.com> wrote:
>> I have run across a memory leak that I have been able to reproduce.  I
>> am profiling the sample application in NetBeans and I believe that I
>> have traced the problem to
>> org.apache.activemq.openwire.v3.BaseDataStreamMarshaller.tightUnmarshalByteSequence(DataInput,
>> BooleanStream)
>>
>> The sample program is a very simple application that sends an object
>> that I wrote to ActiveMQ every 200ms.  In NetBeans I am using the
>> "Live Allocated Objects" view and approximately 80% of all objects are
>> byte[].  If I view the Allocation Call Tree, the first few methods in
>> the tree are:
>>
>> BaseDataStreamMarshaller.tightUnmarshalByteSequence(DataInput, BooleanStream)
>>   org.apache.activemq.util.ByteArrayOutputStream.checkCapacity(int)
>>       org.apache.activemq.util.ByteArrayOutputStream.<init>
>>          java.lang.StringCoding$StringEncoder.encode(char[],int,int)
>>
>> The object that I am sending is a simple bean class and only contains
>> an int, String and byte[].
>>
>> I am using the base configuration for ActiveMQ.  All my sample
>> application does is call sendObject(Serializable) every 200ms.  Here
>> is the simple JMS library that I wrote:
>>
>> ------------- START --------------------------
>> public class JmsLib {
>>
>>    private TopicConnection connection;
>>    private Session session;
>>    private Topic destination;
>>    private MessageProducer producer;
>>    private MessageConsumer consumer;
>>
>>    public JmsLib( ActiveMQConnectionFactory connFactory, String dest
>> ) throws JMSException {
>>
>>        connection = connFactory.createTopicConnection();
>>        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
>>        destination = session.createTopic( dest );
>>        producer = session.createProducer( destination );
>>        consumer = session.createConsumer( destination );
>>        connection.start();
>>    }
>>
>>    public void addMessageListener( MessageListener listener ) throws
>> JMSException{
>>        consumer.setMessageListener( listener );
>>    }
>>
>>    public void sendObject( Serializable object ) throws JMSException{
>>        ObjectMessage message = session.createObjectMessage( object );
>>        producer.send(message);
>>    }
>> }
>> --------------- END --------------------------
>>
>> Thanks for any help you may have...
>>
>

Mime
View raw message