You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Mark Webb <el...@gmail.com> on 2008/10/10 02:55:31 UTC

memory leak problem with ActiveMQ 5.1

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...

Re: memory leak problem with ActiveMQ 5.1

Posted by Mark <el...@gmail.com>.
Part of my problem I found was that I wrapped the parts of the JMS
library that I needed into my own library.  For each endpoint I was
creating a producer AND consumer regardless if I need both or not.
This was leading to the producer/consumer eating up memory by creating
objects that I did not need or ever use.


On Mon, Jun 28, 2010 at 4:31 AM, Gary Tully <ga...@gmail.com> wrote:
> Maybe some of the following options are relevant
> http://activemq.apache.org/javalangoutofmemory.html#java.lang.OutOfMemory-SpoolingMessagestoDisk
>
> On 28 June 2010 08:37, PatrickVB <pa...@gmail.com> wrote:
>
>>
>> Hi,
>>
>> I know this thread is quite old. I'm getting the same error.
>> The JVM which is sending message to the broker is getting an OOM.
>>
>> I'm using 5.3.1. For message sending I use stream message.
>>
>> Regards
>>
>> Patrick
>>
>>
>>
>> elihusmails wrote:
>> >
>> > 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 <el...@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...
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/memory-leak-problem-with-ActiveMQ-5.1-tp19910141p29008506.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
>
>
> --
> http://blog.garytully.com
>
> Open Source Integration
> http://fusesource.com
>

Re: memory leak problem with ActiveMQ 5.1

Posted by Gary Tully <ga...@gmail.com>.
Maybe some of the following options are relevant
http://activemq.apache.org/javalangoutofmemory.html#java.lang.OutOfMemory-SpoolingMessagestoDisk

On 28 June 2010 08:37, PatrickVB <pa...@gmail.com> wrote:

>
> Hi,
>
> I know this thread is quite old. I'm getting the same error.
> The JVM which is sending message to the broker is getting an OOM.
>
> I'm using 5.3.1. For message sending I use stream message.
>
> Regards
>
> Patrick
>
>
>
> elihusmails wrote:
> >
> > 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 <el...@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...
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/memory-leak-problem-with-ActiveMQ-5.1-tp19910141p29008506.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: memory leak problem with ActiveMQ 5.1

Posted by PatrickVB <pa...@gmail.com>.
Hi,

I know this thread is quite old. I'm getting the same error.
The JVM which is sending message to the broker is getting an OOM. 

I'm using 5.3.1. For message sending I use stream message.

Regards

Patrick



elihusmails wrote:
> 
> 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 <el...@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...
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/memory-leak-problem-with-ActiveMQ-5.1-tp19910141p29008506.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: memory leak problem with ActiveMQ 5.1

Posted by Gary Tully <ga...@gmail.com>.
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 <el...@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 <el...@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...
>>
>

Re: memory leak problem with ActiveMQ 5.1

Posted by Elihu Smails <el...@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 <el...@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...
>

Re: memory leak problem with ActiveMQ 5.1

Posted by Mark Webb <el...@gmail.com>.
So I would see this increase in memory on the JMS sender?  This seems a
little strange.  I have tried ActiveMQ 5.2 and see the same problem on the
sending client application.




On Fri, Oct 10, 2008 at 2:39 AM, Rob Davies <ra...@gmail.com> wrote:

> That's not a a memory leak you're seeing - that's the wacky  Retroactive
> Consumer functionality - see
> http://activemq.apache.org/retroactive-consumer.html
> The default policy is FixedSizeSubscrptionRecoveryPolicy - and the default
> cache size for each topic in 5.1 is about 6mb. I'd suggest configuring a
> smaller size for the cache (this is done by default in 5.2) - or disabling
> it all together ;) - see see
> http://activemq.apache.org/subscription-recovery-policy.html
>
>
> cheers,
>
> Rob
>
> http://fusesource.com
> http://rajdavies.blogspot.com/
>
>
>
>
> On 10 Oct 2008, at 01:55, Mark Webb 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...
>>
>
>

Re: memory leak problem with ActiveMQ 5.1

Posted by James Strachan <ja...@gmail.com>.
2008/10/14 Mark Webb <el...@gmail.com>:
> nevermind, I thought this was a source code change....

It was - on trunk


-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Re: memory leak problem with ActiveMQ 5.1

Posted by Mark Webb <el...@gmail.com>.
nevermind, I thought this was a source code change....

On Tue, Oct 14, 2008 at 1:52 PM, Mark Webb <el...@gmail.com> wrote:

> on what branch did you check this in on?  I just performed an update on the
> trunk and see no changes.
>
>
>
>
> On Tue, Oct 14, 2008 at 10:36 AM, James Strachan <james.strachan@gmail.com
> > wrote:
>
>> 2008/10/14 Mark Webb <el...@gmail.com>:
>> > You would be my new best friend if you did  :)
>>
>> Done! :)
>>
>> --
>> James
>> -------
>> http://macstrac.blogspot.com/
>>
>> Open Source Integration
>> http://fusesource.com/
>>
>
>

Re: memory leak problem with ActiveMQ 5.1

Posted by Mark Webb <el...@gmail.com>.
on what branch did you check this in on?  I just performed an update on the
trunk and see no changes.



On Tue, Oct 14, 2008 at 10:36 AM, James Strachan
<ja...@gmail.com>wrote:

> 2008/10/14 Mark Webb <el...@gmail.com>:
> > You would be my new best friend if you did  :)
>
> Done! :)
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>

Re: memory leak problem with ActiveMQ 5.1

Posted by James Strachan <ja...@gmail.com>.
2008/10/14 Mark Webb <el...@gmail.com>:
> You would be my new best friend if you did  :)

Done! :)

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Re: memory leak problem with ActiveMQ 5.1

Posted by Mark Webb <el...@gmail.com>.
You would be my new best friend if you did  :)

In my opinion, it seems to me like this should be turned off by default and
then the option to turn it on is available.  I am hitting OutOfMemory errors
after 10,000 messages, which takes about an hour for me.

On Tue, Oct 14, 2008 at 10:16 AM, James Strachan
<ja...@gmail.com>wrote:

> 2008/10/10 Rob Davies <ra...@gmail.com>:
> > That's not a a memory leak you're seeing - that's the wacky  Retroactive
> > Consumer functionality - see
> > http://activemq.apache.org/retroactive-consumer.html
> > The default policy is FixedSizeSubscrptionRecoveryPolicy - and the
> default
> > cache size for each topic in 5.1 is about 6mb. I'd suggest configuring a
> > smaller size for the cache (this is done by default in 5.2) - or
> disabling
> > it all together ;) - see see
> > http://activemq.apache.org/subscription-recovery-policy.html
>
> I wonder if we should comment out the use of this policy by default?
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>

Re: memory leak problem with ActiveMQ 5.1

Posted by James Strachan <ja...@gmail.com>.
2008/10/10 Rob Davies <ra...@gmail.com>:
> That's not a a memory leak you're seeing - that's the wacky  Retroactive
> Consumer functionality - see
> http://activemq.apache.org/retroactive-consumer.html
> The default policy is FixedSizeSubscrptionRecoveryPolicy - and the default
> cache size for each topic in 5.1 is about 6mb. I'd suggest configuring a
> smaller size for the cache (this is done by default in 5.2) - or disabling
> it all together ;) - see see
> http://activemq.apache.org/subscription-recovery-policy.html

I wonder if we should comment out the use of this policy by default?
-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Re: memory leak problem with ActiveMQ 5.1

Posted by Rob Davies <ra...@gmail.com>.
That's not a a memory leak you're seeing - that's the wacky   
Retroactive Consumer functionality - see http://activemq.apache.org/retroactive-consumer.html
The default policy is FixedSizeSubscrptionRecoveryPolicy - and the  
default cache size for each topic in 5.1 is about 6mb. I'd suggest  
configuring a smaller size for the cache (this is done by default in  
5.2) - or disabling it all together ;) - see see http://activemq.apache.org/subscription-recovery-policy.html


cheers,

Rob

http://fusesource.com
http://rajdavies.blogspot.com/



On 10 Oct 2008, at 01:55, Mark Webb 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...