You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by James Strachan <ja...@gmail.com> on 2006/08/23 14:42:03 UTC

Re: INFO Service - Sync error occurred: java.lang.Ou

That memory limit looks a bit big; its about 7Gb I'd maybe set it to
be around 100Mb insteead

On 8/23/06, pradeep <pr...@gmail.com> wrote:
>
> 1. Created  a durable subsriber for 5 different topics and disonnected the
> clients
> 2. Tried to send 1000 messages to each topic (message size =100kb) in
> parallel
>     5 threads were created each sending messages to different topics
>      (Separate connection Factory lookup and topic lookup)
>     I got this error this
>
> INFO  Service                        - Sync error occurred:
> java.lang.OutOfMemoryError: Java heap space
> java.lang.OutOfMemoryError: Java heap space
>
> WARN  JournalMessageStore            - Message could not be added to long
> term store: Java heap space
> java.lang.OutOfMemoryError: Java heap space
>
>
> I am running the activemq with -xms 256m -xmx1000m.
> activemq.xml has
>  <memoryManager>
>         <usageManager id="memory-manager" limit="8048576000"/>
>     </memoryManager>
>
> Why is the error coming ?
> --
> View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by pradeep <pr...@gmail.com>.
Thanks Balakumar Narayanasamy.

I believe that the producer/consumer should n't be worried about memory of
the JMS server.It can't keep track of messages. there are lot of client
which would connect to the server.

I am of the view that the JMS server should be the one taking care of memory
and removing messages from  memory when there are no client around.


Balakumar Narayanasamy wrote:
> 
> Hi pradeep,
> I also faced same problem...
> 
> Solution which i adapted is we can have counter for queue whenever we pull
> or push message, we can increment or decrement the counter. You can
> configure threshold value say 750 and you can check your counter while you
> push message to queue. By doing this, you can avoid memory heap error with
> costing performance too much. 
> make threshold value configureable and so size can determined on basis of
> RAM. 
> 
> This will work.
> 
> 
> 
> 
> James.Strachan wrote:
>> 
>> We cache things in RAM since consumers will typically need to read the
>> message too. BTW you're using persistent messaging right? You're
>> setting the PERSISTENT flag on the producer's delivery mode?
>> 
>> Are you using Derby? You could switch to another JDBC driver to avoid
>> the in-RAM JDBC driver using up RAM too.
>> 
>> 
>> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>>>
>>> James,
>>>
>>> When using JDBC persistence I am seeing that the messages are stored in
>>> memory even after being persisted in database. They are not getting
>>> removed
>>> and this is resulting in outofmemory error.
>>> If I am not wrong, in case of JDBCpersistence adapter the messages will
>>> not
>>> be kept in memory after being written to the db ?
>>>
>>> Pradeep
>>>
>>> James.Strachan wrote:
>>> >
>>> > Incidentally you could disable the journal if you have limited RAM and
>>> > are happy to trade performance for lower RAM usage...
>>> >
>>> > use <jdbcPersistenceAdapter/> instead in your XML like this example
>>> >
>>> > http://incubator.apache.org/activemq/jdbc-master-slave.html
>>> >
>>> > its much slower but doesn't require messages to be kept in RAM until a
>>> > checkpoint.
>>> >
>>> >
>>> > On 8/24/06, James Strachan <ja...@gmail.com> wrote:
>>> >> Are you sure you are definitely setting the Java heap size? e.g. its
>>> >> usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do you
>>> >> see it using up 1Gb of RAM when you only have a 100Mb usage manager
>>> >> setting?
>>> >>
>>> >> Note that ActiveMQ uses a high performance journal so that messages
>>> >> are only evicted from RAM when a checkpoint to JDBC occurs, not the
>>> >> exact second that a message is consumed.
>>> >>
>>> >> So you are sending 1000 messages to 5 topics of 100K. So thats about
>>> >> 500Mb of messages. So I'd try set your memoryManager to be 800mb and
>>> >> your Java heap to be about 2000M and that should work - use JMX to
>>> see
>>> >> how much memory its using and how many messages get sent to the
>>> >> queues.
>>> >>
>>> >>
>>> >> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>>> >> >
>>> >> > Thanks James.
>>> >> > I am using 4.0.1. I tried lowering the memory to 100MB. It did not
>>> >> work.
>>> >> > I increased the size to 400 MB, 800mb etc.
>>> >> >
>>> >> > It still gives me
>>> >> > Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
>>> >> > java.lang.OutOfMemoryError: Java heap space
>>> >> >
>>> >> > Why doesn't ActiveMQ remove the messages from memory when it has
>>> >> already
>>> >> > persisted messages into database. I am seeing  the memory problem
>>> in
>>> >> > ActiveMQ and not other JMS server that I am evaluating.
>>> >> > James, can you please help me here.
>>> >> >
>>> >> > Pradeep
>>> >> >
>>> >> >
>>> >> > James.Strachan wrote:
>>> >> > >
>>> >> > > FWIW if you use ActiveMQ 4.1 you can configure the memory limit
>>> via
>>> >> > >
>>> >> > > <usageManager limitMb="100"/>
>>> >> > >
>>> >> > > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
>>> >> > >> That memory limit looks a bit big; its about 7Gb I'd maybe set
>>> it to
>>> >> > >> be around 100Mb insteead
>>> >> > >>
>>> >> > >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
>>> >> > >> >
>>> >> > >> > 1. Created  a durable subsriber for 5 different topics and
>>> >> disonnected
>>> >> > >> the
>>> >> > >> > clients
>>> >> > >> > 2. Tried to send 1000 messages to each topic (message size
>>> =100kb)
>>> >> in
>>> >> > >> > parallel
>>> >> > >> >     5 threads were created each sending messages to different
>>> >> topics
>>> >> > >> >      (Separate connection Factory lookup and topic lookup)
>>> >> > >> >     I got this error this
>>> >> > >> >
>>> >> > >> > INFO  Service                        - Sync error occurred:
>>> >> > >> > java.lang.OutOfMemoryError: Java heap space
>>> >> > >> > java.lang.OutOfMemoryError: Java heap space
>>> >> > >> >
>>> >> > >> > WARN  JournalMessageStore            - Message could not be
>>> added
>>> >> to
>>> >> > >> long
>>> >> > >> > term store: Java heap space
>>> >> > >> > java.lang.OutOfMemoryError: Java heap space
>>> >> > >> >
>>> >> > >> >
>>> >> > >> > I am running the activemq with -xms 256m -xmx1000m.
>>> >> > >> > activemq.xml has
>>> >> > >> >  <memoryManager>
>>> >> > >> >         <usageManager id="memory-manager" limit="8048576000"/>
>>> >> > >> >     </memoryManager>
>>> >> > >> >
>>> >> > >> > Why is the error coming ?
>>> >> > >> > --
>>> >> > >> > View this message in context:
>>> >> > >>
>>> >>
>>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
>>> >> > >> > Sent from the ActiveMQ - User forum at Nabble.com.
>>> >> > >> >
>>> >> > >> >
>>> >> > >>
>>> >> > >>
>>> >> > >> --
>>> >> > >>
>>> >> > >> James
>>> >> > >> -------
>>> >> > >> http://radio.weblogs.com/0112098/
>>> >> > >>
>>> >> > >
>>> >> > >
>>> >> > > --
>>> >> > >
>>> >> > > James
>>> >> > > -------
>>> >> > > http://radio.weblogs.com/0112098/
>>> >> > >
>>> >> > >
>>> >> >
>>> >> > --
>>> >> > View this message in context:
>>> >>
>>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
>>> >> > Sent from the ActiveMQ - User forum at Nabble.com.
>>> >> >
>>> >> >
>>> >>
>>> >>
>>> >> --
>>> >>
>>> >> James
>>> >> -------
>>> >> http://radio.weblogs.com/0112098/
>>> >>
>>> >
>>> >
>>> > --
>>> >
>>> > James
>>> > -------
>>> > http://radio.weblogs.com/0112098/
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5960761
>>> Sent from the ActiveMQ - User forum at Nabble.com.
>>>
>>>
>> 
>> 
>> -- 
>> 
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5961838
Sent from the ActiveMQ - User forum at Nabble.com.


Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by Balakumar Narayanasamy <ba...@gmail.com>.
Hi pradeep,
I also faced same problem...

Solution which i adapted is we can have counter for queue whenever we pull
or push message, we can increment or decrement the counter. You can
configure threshold value say 750 and you can check your counter while you
push message to queue. By doing this, you can avoid memory heap error with
costing performance too much. 
make threshold value configureable and so size can determined on basis of
RAM. 

This will work.




James.Strachan wrote:
> 
> We cache things in RAM since consumers will typically need to read the
> message too. BTW you're using persistent messaging right? You're
> setting the PERSISTENT flag on the producer's delivery mode?
> 
> Are you using Derby? You could switch to another JDBC driver to avoid
> the in-RAM JDBC driver using up RAM too.
> 
> 
> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>>
>> James,
>>
>> When using JDBC persistence I am seeing that the messages are stored in
>> memory even after being persisted in database. They are not getting
>> removed
>> and this is resulting in outofmemory error.
>> If I am not wrong, in case of JDBCpersistence adapter the messages will
>> not
>> be kept in memory after being written to the db ?
>>
>> Pradeep
>>
>> James.Strachan wrote:
>> >
>> > Incidentally you could disable the journal if you have limited RAM and
>> > are happy to trade performance for lower RAM usage...
>> >
>> > use <jdbcPersistenceAdapter/> instead in your XML like this example
>> >
>> > http://incubator.apache.org/activemq/jdbc-master-slave.html
>> >
>> > its much slower but doesn't require messages to be kept in RAM until a
>> > checkpoint.
>> >
>> >
>> > On 8/24/06, James Strachan <ja...@gmail.com> wrote:
>> >> Are you sure you are definitely setting the Java heap size? e.g. its
>> >> usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do you
>> >> see it using up 1Gb of RAM when you only have a 100Mb usage manager
>> >> setting?
>> >>
>> >> Note that ActiveMQ uses a high performance journal so that messages
>> >> are only evicted from RAM when a checkpoint to JDBC occurs, not the
>> >> exact second that a message is consumed.
>> >>
>> >> So you are sending 1000 messages to 5 topics of 100K. So thats about
>> >> 500Mb of messages. So I'd try set your memoryManager to be 800mb and
>> >> your Java heap to be about 2000M and that should work - use JMX to see
>> >> how much memory its using and how many messages get sent to the
>> >> queues.
>> >>
>> >>
>> >> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>> >> >
>> >> > Thanks James.
>> >> > I am using 4.0.1. I tried lowering the memory to 100MB. It did not
>> >> work.
>> >> > I increased the size to 400 MB, 800mb etc.
>> >> >
>> >> > It still gives me
>> >> > Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
>> >> > java.lang.OutOfMemoryError: Java heap space
>> >> >
>> >> > Why doesn't ActiveMQ remove the messages from memory when it has
>> >> already
>> >> > persisted messages into database. I am seeing  the memory problem in
>> >> > ActiveMQ and not other JMS server that I am evaluating.
>> >> > James, can you please help me here.
>> >> >
>> >> > Pradeep
>> >> >
>> >> >
>> >> > James.Strachan wrote:
>> >> > >
>> >> > > FWIW if you use ActiveMQ 4.1 you can configure the memory limit
>> via
>> >> > >
>> >> > > <usageManager limitMb="100"/>
>> >> > >
>> >> > > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
>> >> > >> That memory limit looks a bit big; its about 7Gb I'd maybe set it
>> to
>> >> > >> be around 100Mb insteead
>> >> > >>
>> >> > >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
>> >> > >> >
>> >> > >> > 1. Created  a durable subsriber for 5 different topics and
>> >> disonnected
>> >> > >> the
>> >> > >> > clients
>> >> > >> > 2. Tried to send 1000 messages to each topic (message size
>> =100kb)
>> >> in
>> >> > >> > parallel
>> >> > >> >     5 threads were created each sending messages to different
>> >> topics
>> >> > >> >      (Separate connection Factory lookup and topic lookup)
>> >> > >> >     I got this error this
>> >> > >> >
>> >> > >> > INFO  Service                        - Sync error occurred:
>> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> > >> >
>> >> > >> > WARN  JournalMessageStore            - Message could not be
>> added
>> >> to
>> >> > >> long
>> >> > >> > term store: Java heap space
>> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> > >> >
>> >> > >> >
>> >> > >> > I am running the activemq with -xms 256m -xmx1000m.
>> >> > >> > activemq.xml has
>> >> > >> >  <memoryManager>
>> >> > >> >         <usageManager id="memory-manager" limit="8048576000"/>
>> >> > >> >     </memoryManager>
>> >> > >> >
>> >> > >> > Why is the error coming ?
>> >> > >> > --
>> >> > >> > View this message in context:
>> >> > >>
>> >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
>> >> > >> > Sent from the ActiveMQ - User forum at Nabble.com.
>> >> > >> >
>> >> > >> >
>> >> > >>
>> >> > >>
>> >> > >> --
>> >> > >>
>> >> > >> James
>> >> > >> -------
>> >> > >> http://radio.weblogs.com/0112098/
>> >> > >>
>> >> > >
>> >> > >
>> >> > > --
>> >> > >
>> >> > > James
>> >> > > -------
>> >> > > http://radio.weblogs.com/0112098/
>> >> > >
>> >> > >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
>> >> > Sent from the ActiveMQ - User forum at Nabble.com.
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >>
>> >> James
>> >> -------
>> >> http://radio.weblogs.com/0112098/
>> >>
>> >
>> >
>> > --
>> >
>> > James
>> > -------
>> > http://radio.weblogs.com/0112098/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5960761
>> Sent from the ActiveMQ - User forum at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5961648
Sent from the ActiveMQ - User forum at Nabble.com.


Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by pradeep <pr...@gmail.com>.
Can this cause problem ? just guessing...

<destinationPolicy>
      <policyMap><policyEntries>
        
          <policyEntry topic="FOO.>">
            <dispatchPolicy>
              <strictOrderDispatchPolicy />
            </dispatchPolicy>
           
           
           
            <subscriptionRecoveryPolicy>
              <lastImageSubscriptionRecoveryPolicy />
            </subscriptionRecoveryPolicy>
          </policyEntry>

      </policyEntries></policyMap>
    </destinationPolicy>

James.Strachan wrote:
> 
> So set your heap to 1000M and your usageManager to 50M and it should
> not run out of memory. If  it still does then you've not properly set
> the heap size or something else is blowing the RAM usage in your
> broker. Use JMX to see the heap size grow above 500M to check you have
> the heap size setup correctly and run a profiler to find your memory
> leak if you are still running out of heap.
> 
> 
> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>>
>> I am sending messages using the method
>> Messageproducer.send(message); By default, delivery mode is peristent
>> right
>> ?
>> I am using Oracle database.
>>
>>  <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
>> destroy-method="close">>
>>          <property name="driverClassName"
>> value="oracle.jdbc.driver.OracleDriver"/>
>>           <property name="url"
>> value="jdbc:oracle:thin:@localhost:1521:xxxx"/>
>>           <property name="username" value="activemq"/>
>>           <property name="password" value="xxxx"/>
>>
>>
>>   </bean>
>> Please help me.
>> Thanks,
>> Pradeep
>>
>> James.Strachan wrote:
>> >
>> > We cache things in RAM since consumers will typically need to read the
>> > message too. BTW you're using persistent messaging right? You're
>> > setting the PERSISTENT flag on the producer's delivery mode?
>> >
>> > Are you using Derby? You could switch to another JDBC driver to avoid
>> > the in-RAM JDBC driver using up RAM too.
>> >
>> >
>> > On 8/24/06, pradeep <pr...@gmail.com> wrote:
>> >>
>> >> James,
>> >>
>> >> When using JDBC persistence I am seeing that the messages are stored
>> in
>> >> memory even after being persisted in database. They are not getting
>> >> removed
>> >> and this is resulting in outofmemory error.
>> >> If I am not wrong, in case of JDBCpersistence adapter the messages
>> will
>> >> not
>> >> be kept in memory after being written to the db ?
>> >>
>> >> Pradeep
>> >>
>> >> James.Strachan wrote:
>> >> >
>> >> > Incidentally you could disable the journal if you have limited RAM
>> and
>> >> > are happy to trade performance for lower RAM usage...
>> >> >
>> >> > use <jdbcPersistenceAdapter/> instead in your XML like this example
>> >> >
>> >> > http://incubator.apache.org/activemq/jdbc-master-slave.html
>> >> >
>> >> > its much slower but doesn't require messages to be kept in RAM until
>> a
>> >> > checkpoint.
>> >> >
>> >> >
>> >> > On 8/24/06, James Strachan <ja...@gmail.com> wrote:
>> >> >> Are you sure you are definitely setting the Java heap size? e.g.
>> its
>> >> >> usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do
>> you
>> >> >> see it using up 1Gb of RAM when you only have a 100Mb usage manager
>> >> >> setting?
>> >> >>
>> >> >> Note that ActiveMQ uses a high performance journal so that messages
>> >> >> are only evicted from RAM when a checkpoint to JDBC occurs, not the
>> >> >> exact second that a message is consumed.
>> >> >>
>> >> >> So you are sending 1000 messages to 5 topics of 100K. So thats
>> about
>> >> >> 500Mb of messages. So I'd try set your memoryManager to be 800mb
>> and
>> >> >> your Java heap to be about 2000M and that should work - use JMX to
>> see
>> >> >> how much memory its using and how many messages get sent to the
>> >> >> queues.
>> >> >>
>> >> >>
>> >> >> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>> >> >> >
>> >> >> > Thanks James.
>> >> >> > I am using 4.0.1. I tried lowering the memory to 100MB. It did
>> not
>> >> >> work.
>> >> >> > I increased the size to 400 MB, 800mb etc.
>> >> >> >
>> >> >> > It still gives me
>> >> >> > Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
>> >> >> > java.lang.OutOfMemoryError: Java heap space
>> >> >> >
>> >> >> > Why doesn't ActiveMQ remove the messages from memory when it has
>> >> >> already
>> >> >> > persisted messages into database. I am seeing  the memory problem
>> in
>> >> >> > ActiveMQ and not other JMS server that I am evaluating.
>> >> >> > James, can you please help me here.
>> >> >> >
>> >> >> > Pradeep
>> >> >> >
>> >> >> >
>> >> >> > James.Strachan wrote:
>> >> >> > >
>> >> >> > > FWIW if you use ActiveMQ 4.1 you can configure the memory limit
>> >> via
>> >> >> > >
>> >> >> > > <usageManager limitMb="100"/>
>> >> >> > >
>> >> >> > > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
>> >> >> > >> That memory limit looks a bit big; its about 7Gb I'd maybe set
>> it
>> >> to
>> >> >> > >> be around 100Mb insteead
>> >> >> > >>
>> >> >> > >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
>> >> >> > >> >
>> >> >> > >> > 1. Created  a durable subsriber for 5 different topics and
>> >> >> disonnected
>> >> >> > >> the
>> >> >> > >> > clients
>> >> >> > >> > 2. Tried to send 1000 messages to each topic (message size
>> >> =100kb)
>> >> >> in
>> >> >> > >> > parallel
>> >> >> > >> >     5 threads were created each sending messages to
>> different
>> >> >> topics
>> >> >> > >> >      (Separate connection Factory lookup and topic lookup)
>> >> >> > >> >     I got this error this
>> >> >> > >> >
>> >> >> > >> > INFO  Service                        - Sync error occurred:
>> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> >> > >> >
>> >> >> > >> > WARN  JournalMessageStore            - Message could not be
>> >> added
>> >> >> to
>> >> >> > >> long
>> >> >> > >> > term store: Java heap space
>> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> >> > >> >
>> >> >> > >> >
>> >> >> > >> > I am running the activemq with -xms 256m -xmx1000m.
>> >> >> > >> > activemq.xml has
>> >> >> > >> >  <memoryManager>
>> >> >> > >> >         <usageManager id="memory-manager"
>> limit="8048576000"/>
>> >> >> > >> >     </memoryManager>
>> >> >> > >> >
>> >> >> > >> > Why is the error coming ?
>> >> >> > >> > --
>> >> >> > >> > View this message in context:
>> >> >> > >>
>> >> >>
>> >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
>> >> >> > >> > Sent from the ActiveMQ - User forum at Nabble.com.
>> >> >> > >> >
>> >> >> > >> >
>> >> >> > >>
>> >> >> > >>
>> >> >> > >> --
>> >> >> > >>
>> >> >> > >> James
>> >> >> > >> -------
>> >> >> > >> http://radio.weblogs.com/0112098/
>> >> >> > >>
>> >> >> > >
>> >> >> > >
>> >> >> > > --
>> >> >> > >
>> >> >> > > James
>> >> >> > > -------
>> >> >> > > http://radio.weblogs.com/0112098/
>> >> >> > >
>> >> >> > >
>> >> >> >
>> >> >> > --
>> >> >> > View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
>> >> >> > Sent from the ActiveMQ - User forum at Nabble.com.
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >> >> --
>> >> >>
>> >> >> James
>> >> >> -------
>> >> >> http://radio.weblogs.com/0112098/
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> >
>> >> > James
>> >> > -------
>> >> > http://radio.weblogs.com/0112098/
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5960761
>> >> Sent from the ActiveMQ - User forum at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> >
>> > James
>> > -------
>> > http://radio.weblogs.com/0112098/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5961729
>> Sent from the ActiveMQ - User forum at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5962256
Sent from the ActiveMQ - User forum at Nabble.com.


Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by pradeep <pr...@gmail.com>.
Can anyone please help me ?
Thanks
pradeep

pradeep wrote:
> 
> I did what you suggested.
> 1. -Xms512m -Xmx1000M 
> 2.  <memoryManager>  
>         <usageManager id="memory-manager" limit="48857600"/>
>    			  		
>     </memoryManager>
> 
> Now I facing the old problem where the producers blocks after sending some
> messages. Here I 
> seeing 217 messages in the database but all the clients are blocked.
> 
> What am I doing wrong ?
> 
> Jprofiler shows 
> .-----
> 500MB -Total
> 100MB -used 
> 400MB -free
> 
> JMX
> ---
> Memory
> Current heap size: 
>    100,801 kbytes
> Committed memory: 
>    518,464 kbytes
> Maximum heap size: 
>  1,012,672 kbytes
> 
> 
> 
> 
> James.Strachan wrote:
>> 
>> So set your heap to 1000M and your usageManager to 50M and it should
>> not run out of memory. If  it still does then you've not properly set
>> the heap size or something else is blowing the RAM usage in your
>> broker. Use JMX to see the heap size grow above 500M to check you have
>> the heap size setup correctly and run a profiler to find your memory
>> leak if you are still running out of heap.
>> 
>> 
>> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>>>
>>> I am sending messages using the method
>>> Messageproducer.send(message); By default, delivery mode is peristent
>>> right
>>> ?
>>> I am using Oracle database.
>>>
>>>  <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
>>> destroy-method="close">>
>>>          <property name="driverClassName"
>>> value="oracle.jdbc.driver.OracleDriver"/>
>>>           <property name="url"
>>> value="jdbc:oracle:thin:@localhost:1521:xxxx"/>
>>>           <property name="username" value="activemq"/>
>>>           <property name="password" value="xxxx"/>
>>>
>>>
>>>   </bean>
>>> Please help me.
>>> Thanks,
>>> Pradeep
>>>
>>> James.Strachan wrote:
>>> >
>>> > We cache things in RAM since consumers will typically need to read the
>>> > message too. BTW you're using persistent messaging right? You're
>>> > setting the PERSISTENT flag on the producer's delivery mode?
>>> >
>>> > Are you using Derby? You could switch to another JDBC driver to avoid
>>> > the in-RAM JDBC driver using up RAM too.
>>> >
>>> >
>>> > On 8/24/06, pradeep <pr...@gmail.com> wrote:
>>> >>
>>> >> James,
>>> >>
>>> >> When using JDBC persistence I am seeing that the messages are stored
>>> in
>>> >> memory even after being persisted in database. They are not getting
>>> >> removed
>>> >> and this is resulting in outofmemory error.
>>> >> If I am not wrong, in case of JDBCpersistence adapter the messages
>>> will
>>> >> not
>>> >> be kept in memory after being written to the db ?
>>> >>
>>> >> Pradeep
>>> >>
>>> >> James.Strachan wrote:
>>> >> >
>>> >> > Incidentally you could disable the journal if you have limited RAM
>>> and
>>> >> > are happy to trade performance for lower RAM usage...
>>> >> >
>>> >> > use <jdbcPersistenceAdapter/> instead in your XML like this example
>>> >> >
>>> >> > http://incubator.apache.org/activemq/jdbc-master-slave.html
>>> >> >
>>> >> > its much slower but doesn't require messages to be kept in RAM
>>> until a
>>> >> > checkpoint.
>>> >> >
>>> >> >
>>> >> > On 8/24/06, James Strachan <ja...@gmail.com> wrote:
>>> >> >> Are you sure you are definitely setting the Java heap size? e.g.
>>> its
>>> >> >> usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do
>>> you
>>> >> >> see it using up 1Gb of RAM when you only have a 100Mb usage
>>> manager
>>> >> >> setting?
>>> >> >>
>>> >> >> Note that ActiveMQ uses a high performance journal so that
>>> messages
>>> >> >> are only evicted from RAM when a checkpoint to JDBC occurs, not
>>> the
>>> >> >> exact second that a message is consumed.
>>> >> >>
>>> >> >> So you are sending 1000 messages to 5 topics of 100K. So thats
>>> about
>>> >> >> 500Mb of messages. So I'd try set your memoryManager to be 800mb
>>> and
>>> >> >> your Java heap to be about 2000M and that should work - use JMX to
>>> see
>>> >> >> how much memory its using and how many messages get sent to the
>>> >> >> queues.
>>> >> >>
>>> >> >>
>>> >> >> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>>> >> >> >
>>> >> >> > Thanks James.
>>> >> >> > I am using 4.0.1. I tried lowering the memory to 100MB. It did
>>> not
>>> >> >> work.
>>> >> >> > I increased the size to 400 MB, 800mb etc.
>>> >> >> >
>>> >> >> > It still gives me
>>> >> >> > Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
>>> >> >> > java.lang.OutOfMemoryError: Java heap space
>>> >> >> >
>>> >> >> > Why doesn't ActiveMQ remove the messages from memory when it has
>>> >> >> already
>>> >> >> > persisted messages into database. I am seeing  the memory
>>> problem in
>>> >> >> > ActiveMQ and not other JMS server that I am evaluating.
>>> >> >> > James, can you please help me here.
>>> >> >> >
>>> >> >> > Pradeep
>>> >> >> >
>>> >> >> >
>>> >> >> > James.Strachan wrote:
>>> >> >> > >
>>> >> >> > > FWIW if you use ActiveMQ 4.1 you can configure the memory
>>> limit
>>> >> via
>>> >> >> > >
>>> >> >> > > <usageManager limitMb="100"/>
>>> >> >> > >
>>> >> >> > > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
>>> >> >> > >> That memory limit looks a bit big; its about 7Gb I'd maybe
>>> set it
>>> >> to
>>> >> >> > >> be around 100Mb insteead
>>> >> >> > >>
>>> >> >> > >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
>>> >> >> > >> >
>>> >> >> > >> > 1. Created  a durable subsriber for 5 different topics and
>>> >> >> disonnected
>>> >> >> > >> the
>>> >> >> > >> > clients
>>> >> >> > >> > 2. Tried to send 1000 messages to each topic (message size
>>> >> =100kb)
>>> >> >> in
>>> >> >> > >> > parallel
>>> >> >> > >> >     5 threads were created each sending messages to
>>> different
>>> >> >> topics
>>> >> >> > >> >      (Separate connection Factory lookup and topic lookup)
>>> >> >> > >> >     I got this error this
>>> >> >> > >> >
>>> >> >> > >> > INFO  Service                        - Sync error occurred:
>>> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
>>> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
>>> >> >> > >> >
>>> >> >> > >> > WARN  JournalMessageStore            - Message could not be
>>> >> added
>>> >> >> to
>>> >> >> > >> long
>>> >> >> > >> > term store: Java heap space
>>> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
>>> >> >> > >> >
>>> >> >> > >> >
>>> >> >> > >> > I am running the activemq with -xms 256m -xmx1000m.
>>> >> >> > >> > activemq.xml has
>>> >> >> > >> >  <memoryManager>
>>> >> >> > >> >         <usageManager id="memory-manager"
>>> limit="8048576000"/>
>>> >> >> > >> >     </memoryManager>
>>> >> >> > >> >
>>> >> >> > >> > Why is the error coming ?
>>> >> >> > >> > --
>>> >> >> > >> > View this message in context:
>>> >> >> > >>
>>> >> >>
>>> >>
>>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
>>> >> >> > >> > Sent from the ActiveMQ - User forum at Nabble.com.
>>> >> >> > >> >
>>> >> >> > >> >
>>> >> >> > >>
>>> >> >> > >>
>>> >> >> > >> --
>>> >> >> > >>
>>> >> >> > >> James
>>> >> >> > >> -------
>>> >> >> > >> http://radio.weblogs.com/0112098/
>>> >> >> > >>
>>> >> >> > >
>>> >> >> > >
>>> >> >> > > --
>>> >> >> > >
>>> >> >> > > James
>>> >> >> > > -------
>>> >> >> > > http://radio.weblogs.com/0112098/
>>> >> >> > >
>>> >> >> > >
>>> >> >> >
>>> >> >> > --
>>> >> >> > View this message in context:
>>> >> >>
>>> >>
>>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
>>> >> >> > Sent from the ActiveMQ - User forum at Nabble.com.
>>> >> >> >
>>> >> >> >
>>> >> >>
>>> >> >>
>>> >> >> --
>>> >> >>
>>> >> >> James
>>> >> >> -------
>>> >> >> http://radio.weblogs.com/0112098/
>>> >> >>
>>> >> >
>>> >> >
>>> >> > --
>>> >> >
>>> >> > James
>>> >> > -------
>>> >> > http://radio.weblogs.com/0112098/
>>> >> >
>>> >> >
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5960761
>>> >> Sent from the ActiveMQ - User forum at Nabble.com.
>>> >>
>>> >>
>>> >
>>> >
>>> > --
>>> >
>>> > James
>>> > -------
>>> > http://radio.weblogs.com/0112098/
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5961729
>>> Sent from the ActiveMQ - User forum at Nabble.com.
>>>
>>>
>> 
>> 
>> -- 
>> 
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5965436
Sent from the ActiveMQ - User forum at Nabble.com.


Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by pradeep <pr...@gmail.com>.
I did what you suggested.
1. -Xms512m -Xmx1000M 
2.  <memoryManager>  
        <usageManager id="memory-manager" limit="48857600"/>
   			  		
    </memoryManager>

Now I facing the old problem where the producers blocks after sending some
messages. Here I 
seeing 217 messages in the database but all the clients are blocked.

What am I doing wrong ?

Jprofiler shows 
.-----
500MB -Total
100MB -used 
400MB -free

JMX
---
Memory
Current heap size: 
   100,801 kbytes
Committed memory: 
   518,464 kbytes
Maximum heap size: 
 1,012,672 kbytes




James.Strachan wrote:
> 
> So set your heap to 1000M and your usageManager to 50M and it should
> not run out of memory. If  it still does then you've not properly set
> the heap size or something else is blowing the RAM usage in your
> broker. Use JMX to see the heap size grow above 500M to check you have
> the heap size setup correctly and run a profiler to find your memory
> leak if you are still running out of heap.
> 
> 
> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>>
>> I am sending messages using the method
>> Messageproducer.send(message); By default, delivery mode is peristent
>> right
>> ?
>> I am using Oracle database.
>>
>>  <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
>> destroy-method="close">>
>>          <property name="driverClassName"
>> value="oracle.jdbc.driver.OracleDriver"/>
>>           <property name="url"
>> value="jdbc:oracle:thin:@localhost:1521:xxxx"/>
>>           <property name="username" value="activemq"/>
>>           <property name="password" value="xxxx"/>
>>
>>
>>   </bean>
>> Please help me.
>> Thanks,
>> Pradeep
>>
>> James.Strachan wrote:
>> >
>> > We cache things in RAM since consumers will typically need to read the
>> > message too. BTW you're using persistent messaging right? You're
>> > setting the PERSISTENT flag on the producer's delivery mode?
>> >
>> > Are you using Derby? You could switch to another JDBC driver to avoid
>> > the in-RAM JDBC driver using up RAM too.
>> >
>> >
>> > On 8/24/06, pradeep <pr...@gmail.com> wrote:
>> >>
>> >> James,
>> >>
>> >> When using JDBC persistence I am seeing that the messages are stored
>> in
>> >> memory even after being persisted in database. They are not getting
>> >> removed
>> >> and this is resulting in outofmemory error.
>> >> If I am not wrong, in case of JDBCpersistence adapter the messages
>> will
>> >> not
>> >> be kept in memory after being written to the db ?
>> >>
>> >> Pradeep
>> >>
>> >> James.Strachan wrote:
>> >> >
>> >> > Incidentally you could disable the journal if you have limited RAM
>> and
>> >> > are happy to trade performance for lower RAM usage...
>> >> >
>> >> > use <jdbcPersistenceAdapter/> instead in your XML like this example
>> >> >
>> >> > http://incubator.apache.org/activemq/jdbc-master-slave.html
>> >> >
>> >> > its much slower but doesn't require messages to be kept in RAM until
>> a
>> >> > checkpoint.
>> >> >
>> >> >
>> >> > On 8/24/06, James Strachan <ja...@gmail.com> wrote:
>> >> >> Are you sure you are definitely setting the Java heap size? e.g.
>> its
>> >> >> usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do
>> you
>> >> >> see it using up 1Gb of RAM when you only have a 100Mb usage manager
>> >> >> setting?
>> >> >>
>> >> >> Note that ActiveMQ uses a high performance journal so that messages
>> >> >> are only evicted from RAM when a checkpoint to JDBC occurs, not the
>> >> >> exact second that a message is consumed.
>> >> >>
>> >> >> So you are sending 1000 messages to 5 topics of 100K. So thats
>> about
>> >> >> 500Mb of messages. So I'd try set your memoryManager to be 800mb
>> and
>> >> >> your Java heap to be about 2000M and that should work - use JMX to
>> see
>> >> >> how much memory its using and how many messages get sent to the
>> >> >> queues.
>> >> >>
>> >> >>
>> >> >> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>> >> >> >
>> >> >> > Thanks James.
>> >> >> > I am using 4.0.1. I tried lowering the memory to 100MB. It did
>> not
>> >> >> work.
>> >> >> > I increased the size to 400 MB, 800mb etc.
>> >> >> >
>> >> >> > It still gives me
>> >> >> > Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
>> >> >> > java.lang.OutOfMemoryError: Java heap space
>> >> >> >
>> >> >> > Why doesn't ActiveMQ remove the messages from memory when it has
>> >> >> already
>> >> >> > persisted messages into database. I am seeing  the memory problem
>> in
>> >> >> > ActiveMQ and not other JMS server that I am evaluating.
>> >> >> > James, can you please help me here.
>> >> >> >
>> >> >> > Pradeep
>> >> >> >
>> >> >> >
>> >> >> > James.Strachan wrote:
>> >> >> > >
>> >> >> > > FWIW if you use ActiveMQ 4.1 you can configure the memory limit
>> >> via
>> >> >> > >
>> >> >> > > <usageManager limitMb="100"/>
>> >> >> > >
>> >> >> > > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
>> >> >> > >> That memory limit looks a bit big; its about 7Gb I'd maybe set
>> it
>> >> to
>> >> >> > >> be around 100Mb insteead
>> >> >> > >>
>> >> >> > >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
>> >> >> > >> >
>> >> >> > >> > 1. Created  a durable subsriber for 5 different topics and
>> >> >> disonnected
>> >> >> > >> the
>> >> >> > >> > clients
>> >> >> > >> > 2. Tried to send 1000 messages to each topic (message size
>> >> =100kb)
>> >> >> in
>> >> >> > >> > parallel
>> >> >> > >> >     5 threads were created each sending messages to
>> different
>> >> >> topics
>> >> >> > >> >      (Separate connection Factory lookup and topic lookup)
>> >> >> > >> >     I got this error this
>> >> >> > >> >
>> >> >> > >> > INFO  Service                        - Sync error occurred:
>> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> >> > >> >
>> >> >> > >> > WARN  JournalMessageStore            - Message could not be
>> >> added
>> >> >> to
>> >> >> > >> long
>> >> >> > >> > term store: Java heap space
>> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> >> > >> >
>> >> >> > >> >
>> >> >> > >> > I am running the activemq with -xms 256m -xmx1000m.
>> >> >> > >> > activemq.xml has
>> >> >> > >> >  <memoryManager>
>> >> >> > >> >         <usageManager id="memory-manager"
>> limit="8048576000"/>
>> >> >> > >> >     </memoryManager>
>> >> >> > >> >
>> >> >> > >> > Why is the error coming ?
>> >> >> > >> > --
>> >> >> > >> > View this message in context:
>> >> >> > >>
>> >> >>
>> >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
>> >> >> > >> > Sent from the ActiveMQ - User forum at Nabble.com.
>> >> >> > >> >
>> >> >> > >> >
>> >> >> > >>
>> >> >> > >>
>> >> >> > >> --
>> >> >> > >>
>> >> >> > >> James
>> >> >> > >> -------
>> >> >> > >> http://radio.weblogs.com/0112098/
>> >> >> > >>
>> >> >> > >
>> >> >> > >
>> >> >> > > --
>> >> >> > >
>> >> >> > > James
>> >> >> > > -------
>> >> >> > > http://radio.weblogs.com/0112098/
>> >> >> > >
>> >> >> > >
>> >> >> >
>> >> >> > --
>> >> >> > View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
>> >> >> > Sent from the ActiveMQ - User forum at Nabble.com.
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >> >> --
>> >> >>
>> >> >> James
>> >> >> -------
>> >> >> http://radio.weblogs.com/0112098/
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> >
>> >> > James
>> >> > -------
>> >> > http://radio.weblogs.com/0112098/
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5960761
>> >> Sent from the ActiveMQ - User forum at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> >
>> > James
>> > -------
>> > http://radio.weblogs.com/0112098/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5961729
>> Sent from the ActiveMQ - User forum at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5962178
Sent from the ActiveMQ - User forum at Nabble.com.


Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by James Strachan <ja...@gmail.com>.
So set your heap to 1000M and your usageManager to 50M and it should
not run out of memory. If  it still does then you've not properly set
the heap size or something else is blowing the RAM usage in your
broker. Use JMX to see the heap size grow above 500M to check you have
the heap size setup correctly and run a profiler to find your memory
leak if you are still running out of heap.


On 8/24/06, pradeep <pr...@gmail.com> wrote:
>
> I am sending messages using the method
> Messageproducer.send(message); By default, delivery mode is peristent right
> ?
> I am using Oracle database.
>
>  <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">>
>          <property name="driverClassName"
> value="oracle.jdbc.driver.OracleDriver"/>
>           <property name="url"
> value="jdbc:oracle:thin:@localhost:1521:xxxx"/>
>           <property name="username" value="activemq"/>
>           <property name="password" value="xxxx"/>
>
>
>   </bean>
> Please help me.
> Thanks,
> Pradeep
>
> James.Strachan wrote:
> >
> > We cache things in RAM since consumers will typically need to read the
> > message too. BTW you're using persistent messaging right? You're
> > setting the PERSISTENT flag on the producer's delivery mode?
> >
> > Are you using Derby? You could switch to another JDBC driver to avoid
> > the in-RAM JDBC driver using up RAM too.
> >
> >
> > On 8/24/06, pradeep <pr...@gmail.com> wrote:
> >>
> >> James,
> >>
> >> When using JDBC persistence I am seeing that the messages are stored in
> >> memory even after being persisted in database. They are not getting
> >> removed
> >> and this is resulting in outofmemory error.
> >> If I am not wrong, in case of JDBCpersistence adapter the messages will
> >> not
> >> be kept in memory after being written to the db ?
> >>
> >> Pradeep
> >>
> >> James.Strachan wrote:
> >> >
> >> > Incidentally you could disable the journal if you have limited RAM and
> >> > are happy to trade performance for lower RAM usage...
> >> >
> >> > use <jdbcPersistenceAdapter/> instead in your XML like this example
> >> >
> >> > http://incubator.apache.org/activemq/jdbc-master-slave.html
> >> >
> >> > its much slower but doesn't require messages to be kept in RAM until a
> >> > checkpoint.
> >> >
> >> >
> >> > On 8/24/06, James Strachan <ja...@gmail.com> wrote:
> >> >> Are you sure you are definitely setting the Java heap size? e.g. its
> >> >> usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do you
> >> >> see it using up 1Gb of RAM when you only have a 100Mb usage manager
> >> >> setting?
> >> >>
> >> >> Note that ActiveMQ uses a high performance journal so that messages
> >> >> are only evicted from RAM when a checkpoint to JDBC occurs, not the
> >> >> exact second that a message is consumed.
> >> >>
> >> >> So you are sending 1000 messages to 5 topics of 100K. So thats about
> >> >> 500Mb of messages. So I'd try set your memoryManager to be 800mb and
> >> >> your Java heap to be about 2000M and that should work - use JMX to see
> >> >> how much memory its using and how many messages get sent to the
> >> >> queues.
> >> >>
> >> >>
> >> >> On 8/24/06, pradeep <pr...@gmail.com> wrote:
> >> >> >
> >> >> > Thanks James.
> >> >> > I am using 4.0.1. I tried lowering the memory to 100MB. It did not
> >> >> work.
> >> >> > I increased the size to 400 MB, 800mb etc.
> >> >> >
> >> >> > It still gives me
> >> >> > Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
> >> >> > java.lang.OutOfMemoryError: Java heap space
> >> >> >
> >> >> > Why doesn't ActiveMQ remove the messages from memory when it has
> >> >> already
> >> >> > persisted messages into database. I am seeing  the memory problem in
> >> >> > ActiveMQ and not other JMS server that I am evaluating.
> >> >> > James, can you please help me here.
> >> >> >
> >> >> > Pradeep
> >> >> >
> >> >> >
> >> >> > James.Strachan wrote:
> >> >> > >
> >> >> > > FWIW if you use ActiveMQ 4.1 you can configure the memory limit
> >> via
> >> >> > >
> >> >> > > <usageManager limitMb="100"/>
> >> >> > >
> >> >> > > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
> >> >> > >> That memory limit looks a bit big; its about 7Gb I'd maybe set it
> >> to
> >> >> > >> be around 100Mb insteead
> >> >> > >>
> >> >> > >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
> >> >> > >> >
> >> >> > >> > 1. Created  a durable subsriber for 5 different topics and
> >> >> disonnected
> >> >> > >> the
> >> >> > >> > clients
> >> >> > >> > 2. Tried to send 1000 messages to each topic (message size
> >> =100kb)
> >> >> in
> >> >> > >> > parallel
> >> >> > >> >     5 threads were created each sending messages to different
> >> >> topics
> >> >> > >> >      (Separate connection Factory lookup and topic lookup)
> >> >> > >> >     I got this error this
> >> >> > >> >
> >> >> > >> > INFO  Service                        - Sync error occurred:
> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
> >> >> > >> >
> >> >> > >> > WARN  JournalMessageStore            - Message could not be
> >> added
> >> >> to
> >> >> > >> long
> >> >> > >> > term store: Java heap space
> >> >> > >> > java.lang.OutOfMemoryError: Java heap space
> >> >> > >> >
> >> >> > >> >
> >> >> > >> > I am running the activemq with -xms 256m -xmx1000m.
> >> >> > >> > activemq.xml has
> >> >> > >> >  <memoryManager>
> >> >> > >> >         <usageManager id="memory-manager" limit="8048576000"/>
> >> >> > >> >     </memoryManager>
> >> >> > >> >
> >> >> > >> > Why is the error coming ?
> >> >> > >> > --
> >> >> > >> > View this message in context:
> >> >> > >>
> >> >>
> >> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
> >> >> > >> > Sent from the ActiveMQ - User forum at Nabble.com.
> >> >> > >> >
> >> >> > >> >
> >> >> > >>
> >> >> > >>
> >> >> > >> --
> >> >> > >>
> >> >> > >> James
> >> >> > >> -------
> >> >> > >> http://radio.weblogs.com/0112098/
> >> >> > >>
> >> >> > >
> >> >> > >
> >> >> > > --
> >> >> > >
> >> >> > > James
> >> >> > > -------
> >> >> > > http://radio.weblogs.com/0112098/
> >> >> > >
> >> >> > >
> >> >> >
> >> >> > --
> >> >> > View this message in context:
> >> >>
> >> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
> >> >> > Sent from the ActiveMQ - User forum at Nabble.com.
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >> --
> >> >>
> >> >> James
> >> >> -------
> >> >> http://radio.weblogs.com/0112098/
> >> >>
> >> >
> >> >
> >> > --
> >> >
> >> > James
> >> > -------
> >> > http://radio.weblogs.com/0112098/
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5960761
> >> Sent from the ActiveMQ - User forum at Nabble.com.
> >>
> >>
> >
> >
> > --
> >
> > James
> > -------
> > http://radio.weblogs.com/0112098/
> >
> >
>
> --
> View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5961729
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by pradeep <pr...@gmail.com>.
I am sending messages using the method 
Messageproducer.send(message); By default, delivery mode is peristent right
?
I am using Oracle database.

 <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">>
         <property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver"/>
          <property name="url"
value="jdbc:oracle:thin:@localhost:1521:xxxx"/>
          <property name="username" value="activemq"/>
          <property name="password" value="xxxx"/>
        

  </bean>
Please help me.
Thanks,
Pradeep

James.Strachan wrote:
> 
> We cache things in RAM since consumers will typically need to read the
> message too. BTW you're using persistent messaging right? You're
> setting the PERSISTENT flag on the producer's delivery mode?
> 
> Are you using Derby? You could switch to another JDBC driver to avoid
> the in-RAM JDBC driver using up RAM too.
> 
> 
> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>>
>> James,
>>
>> When using JDBC persistence I am seeing that the messages are stored in
>> memory even after being persisted in database. They are not getting
>> removed
>> and this is resulting in outofmemory error.
>> If I am not wrong, in case of JDBCpersistence adapter the messages will
>> not
>> be kept in memory after being written to the db ?
>>
>> Pradeep
>>
>> James.Strachan wrote:
>> >
>> > Incidentally you could disable the journal if you have limited RAM and
>> > are happy to trade performance for lower RAM usage...
>> >
>> > use <jdbcPersistenceAdapter/> instead in your XML like this example
>> >
>> > http://incubator.apache.org/activemq/jdbc-master-slave.html
>> >
>> > its much slower but doesn't require messages to be kept in RAM until a
>> > checkpoint.
>> >
>> >
>> > On 8/24/06, James Strachan <ja...@gmail.com> wrote:
>> >> Are you sure you are definitely setting the Java heap size? e.g. its
>> >> usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do you
>> >> see it using up 1Gb of RAM when you only have a 100Mb usage manager
>> >> setting?
>> >>
>> >> Note that ActiveMQ uses a high performance journal so that messages
>> >> are only evicted from RAM when a checkpoint to JDBC occurs, not the
>> >> exact second that a message is consumed.
>> >>
>> >> So you are sending 1000 messages to 5 topics of 100K. So thats about
>> >> 500Mb of messages. So I'd try set your memoryManager to be 800mb and
>> >> your Java heap to be about 2000M and that should work - use JMX to see
>> >> how much memory its using and how many messages get sent to the
>> >> queues.
>> >>
>> >>
>> >> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>> >> >
>> >> > Thanks James.
>> >> > I am using 4.0.1. I tried lowering the memory to 100MB. It did not
>> >> work.
>> >> > I increased the size to 400 MB, 800mb etc.
>> >> >
>> >> > It still gives me
>> >> > Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
>> >> > java.lang.OutOfMemoryError: Java heap space
>> >> >
>> >> > Why doesn't ActiveMQ remove the messages from memory when it has
>> >> already
>> >> > persisted messages into database. I am seeing  the memory problem in
>> >> > ActiveMQ and not other JMS server that I am evaluating.
>> >> > James, can you please help me here.
>> >> >
>> >> > Pradeep
>> >> >
>> >> >
>> >> > James.Strachan wrote:
>> >> > >
>> >> > > FWIW if you use ActiveMQ 4.1 you can configure the memory limit
>> via
>> >> > >
>> >> > > <usageManager limitMb="100"/>
>> >> > >
>> >> > > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
>> >> > >> That memory limit looks a bit big; its about 7Gb I'd maybe set it
>> to
>> >> > >> be around 100Mb insteead
>> >> > >>
>> >> > >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
>> >> > >> >
>> >> > >> > 1. Created  a durable subsriber for 5 different topics and
>> >> disonnected
>> >> > >> the
>> >> > >> > clients
>> >> > >> > 2. Tried to send 1000 messages to each topic (message size
>> =100kb)
>> >> in
>> >> > >> > parallel
>> >> > >> >     5 threads were created each sending messages to different
>> >> topics
>> >> > >> >      (Separate connection Factory lookup and topic lookup)
>> >> > >> >     I got this error this
>> >> > >> >
>> >> > >> > INFO  Service                        - Sync error occurred:
>> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> > >> >
>> >> > >> > WARN  JournalMessageStore            - Message could not be
>> added
>> >> to
>> >> > >> long
>> >> > >> > term store: Java heap space
>> >> > >> > java.lang.OutOfMemoryError: Java heap space
>> >> > >> >
>> >> > >> >
>> >> > >> > I am running the activemq with -xms 256m -xmx1000m.
>> >> > >> > activemq.xml has
>> >> > >> >  <memoryManager>
>> >> > >> >         <usageManager id="memory-manager" limit="8048576000"/>
>> >> > >> >     </memoryManager>
>> >> > >> >
>> >> > >> > Why is the error coming ?
>> >> > >> > --
>> >> > >> > View this message in context:
>> >> > >>
>> >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
>> >> > >> > Sent from the ActiveMQ - User forum at Nabble.com.
>> >> > >> >
>> >> > >> >
>> >> > >>
>> >> > >>
>> >> > >> --
>> >> > >>
>> >> > >> James
>> >> > >> -------
>> >> > >> http://radio.weblogs.com/0112098/
>> >> > >>
>> >> > >
>> >> > >
>> >> > > --
>> >> > >
>> >> > > James
>> >> > > -------
>> >> > > http://radio.weblogs.com/0112098/
>> >> > >
>> >> > >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
>> >> > Sent from the ActiveMQ - User forum at Nabble.com.
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >>
>> >> James
>> >> -------
>> >> http://radio.weblogs.com/0112098/
>> >>
>> >
>> >
>> > --
>> >
>> > James
>> > -------
>> > http://radio.weblogs.com/0112098/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5960761
>> Sent from the ActiveMQ - User forum at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5961729
Sent from the ActiveMQ - User forum at Nabble.com.


Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by James Strachan <ja...@gmail.com>.
We cache things in RAM since consumers will typically need to read the
message too. BTW you're using persistent messaging right? You're
setting the PERSISTENT flag on the producer's delivery mode?

Are you using Derby? You could switch to another JDBC driver to avoid
the in-RAM JDBC driver using up RAM too.


On 8/24/06, pradeep <pr...@gmail.com> wrote:
>
> James,
>
> When using JDBC persistence I am seeing that the messages are stored in
> memory even after being persisted in database. They are not getting removed
> and this is resulting in outofmemory error.
> If I am not wrong, in case of JDBCpersistence adapter the messages will not
> be kept in memory after being written to the db ?
>
> Pradeep
>
> James.Strachan wrote:
> >
> > Incidentally you could disable the journal if you have limited RAM and
> > are happy to trade performance for lower RAM usage...
> >
> > use <jdbcPersistenceAdapter/> instead in your XML like this example
> >
> > http://incubator.apache.org/activemq/jdbc-master-slave.html
> >
> > its much slower but doesn't require messages to be kept in RAM until a
> > checkpoint.
> >
> >
> > On 8/24/06, James Strachan <ja...@gmail.com> wrote:
> >> Are you sure you are definitely setting the Java heap size? e.g. its
> >> usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do you
> >> see it using up 1Gb of RAM when you only have a 100Mb usage manager
> >> setting?
> >>
> >> Note that ActiveMQ uses a high performance journal so that messages
> >> are only evicted from RAM when a checkpoint to JDBC occurs, not the
> >> exact second that a message is consumed.
> >>
> >> So you are sending 1000 messages to 5 topics of 100K. So thats about
> >> 500Mb of messages. So I'd try set your memoryManager to be 800mb and
> >> your Java heap to be about 2000M and that should work - use JMX to see
> >> how much memory its using and how many messages get sent to the
> >> queues.
> >>
> >>
> >> On 8/24/06, pradeep <pr...@gmail.com> wrote:
> >> >
> >> > Thanks James.
> >> > I am using 4.0.1. I tried lowering the memory to 100MB. It did not
> >> work.
> >> > I increased the size to 400 MB, 800mb etc.
> >> >
> >> > It still gives me
> >> > Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
> >> > java.lang.OutOfMemoryError: Java heap space
> >> >
> >> > Why doesn't ActiveMQ remove the messages from memory when it has
> >> already
> >> > persisted messages into database. I am seeing  the memory problem in
> >> > ActiveMQ and not other JMS server that I am evaluating.
> >> > James, can you please help me here.
> >> >
> >> > Pradeep
> >> >
> >> >
> >> > James.Strachan wrote:
> >> > >
> >> > > FWIW if you use ActiveMQ 4.1 you can configure the memory limit via
> >> > >
> >> > > <usageManager limitMb="100"/>
> >> > >
> >> > > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
> >> > >> That memory limit looks a bit big; its about 7Gb I'd maybe set it to
> >> > >> be around 100Mb insteead
> >> > >>
> >> > >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
> >> > >> >
> >> > >> > 1. Created  a durable subsriber for 5 different topics and
> >> disonnected
> >> > >> the
> >> > >> > clients
> >> > >> > 2. Tried to send 1000 messages to each topic (message size =100kb)
> >> in
> >> > >> > parallel
> >> > >> >     5 threads were created each sending messages to different
> >> topics
> >> > >> >      (Separate connection Factory lookup and topic lookup)
> >> > >> >     I got this error this
> >> > >> >
> >> > >> > INFO  Service                        - Sync error occurred:
> >> > >> > java.lang.OutOfMemoryError: Java heap space
> >> > >> > java.lang.OutOfMemoryError: Java heap space
> >> > >> >
> >> > >> > WARN  JournalMessageStore            - Message could not be added
> >> to
> >> > >> long
> >> > >> > term store: Java heap space
> >> > >> > java.lang.OutOfMemoryError: Java heap space
> >> > >> >
> >> > >> >
> >> > >> > I am running the activemq with -xms 256m -xmx1000m.
> >> > >> > activemq.xml has
> >> > >> >  <memoryManager>
> >> > >> >         <usageManager id="memory-manager" limit="8048576000"/>
> >> > >> >     </memoryManager>
> >> > >> >
> >> > >> > Why is the error coming ?
> >> > >> > --
> >> > >> > View this message in context:
> >> > >>
> >> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
> >> > >> > Sent from the ActiveMQ - User forum at Nabble.com.
> >> > >> >
> >> > >> >
> >> > >>
> >> > >>
> >> > >> --
> >> > >>
> >> > >> James
> >> > >> -------
> >> > >> http://radio.weblogs.com/0112098/
> >> > >>
> >> > >
> >> > >
> >> > > --
> >> > >
> >> > > James
> >> > > -------
> >> > > http://radio.weblogs.com/0112098/
> >> > >
> >> > >
> >> >
> >> > --
> >> > View this message in context:
> >> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
> >> > Sent from the ActiveMQ - User forum at Nabble.com.
> >> >
> >> >
> >>
> >>
> >> --
> >>
> >> James
> >> -------
> >> http://radio.weblogs.com/0112098/
> >>
> >
> >
> > --
> >
> > James
> > -------
> > http://radio.weblogs.com/0112098/
> >
> >
>
> --
> View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5960761
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by pradeep <pr...@gmail.com>.
James,

When using JDBC persistence I am seeing that the messages are stored in
memory even after being persisted in database. They are not getting removed
and this is resulting in outofmemory error.
If I am not wrong, in case of JDBCpersistence adapter the messages will not
be kept in memory after being written to the db ?

Pradeep

James.Strachan wrote:
> 
> Incidentally you could disable the journal if you have limited RAM and
> are happy to trade performance for lower RAM usage...
> 
> use <jdbcPersistenceAdapter/> instead in your XML like this example
> 
> http://incubator.apache.org/activemq/jdbc-master-slave.html
> 
> its much slower but doesn't require messages to be kept in RAM until a
> checkpoint.
> 
> 
> On 8/24/06, James Strachan <ja...@gmail.com> wrote:
>> Are you sure you are definitely setting the Java heap size? e.g. its
>> usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do you
>> see it using up 1Gb of RAM when you only have a 100Mb usage manager
>> setting?
>>
>> Note that ActiveMQ uses a high performance journal so that messages
>> are only evicted from RAM when a checkpoint to JDBC occurs, not the
>> exact second that a message is consumed.
>>
>> So you are sending 1000 messages to 5 topics of 100K. So thats about
>> 500Mb of messages. So I'd try set your memoryManager to be 800mb and
>> your Java heap to be about 2000M and that should work - use JMX to see
>> how much memory its using and how many messages get sent to the
>> queues.
>>
>>
>> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>> >
>> > Thanks James.
>> > I am using 4.0.1. I tried lowering the memory to 100MB. It did not
>> work.
>> > I increased the size to 400 MB, 800mb etc.
>> >
>> > It still gives me
>> > Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
>> > java.lang.OutOfMemoryError: Java heap space
>> >
>> > Why doesn't ActiveMQ remove the messages from memory when it has
>> already
>> > persisted messages into database. I am seeing  the memory problem in
>> > ActiveMQ and not other JMS server that I am evaluating.
>> > James, can you please help me here.
>> >
>> > Pradeep
>> >
>> >
>> > James.Strachan wrote:
>> > >
>> > > FWIW if you use ActiveMQ 4.1 you can configure the memory limit via
>> > >
>> > > <usageManager limitMb="100"/>
>> > >
>> > > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
>> > >> That memory limit looks a bit big; its about 7Gb I'd maybe set it to
>> > >> be around 100Mb insteead
>> > >>
>> > >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
>> > >> >
>> > >> > 1. Created  a durable subsriber for 5 different topics and
>> disonnected
>> > >> the
>> > >> > clients
>> > >> > 2. Tried to send 1000 messages to each topic (message size =100kb)
>> in
>> > >> > parallel
>> > >> >     5 threads were created each sending messages to different
>> topics
>> > >> >      (Separate connection Factory lookup and topic lookup)
>> > >> >     I got this error this
>> > >> >
>> > >> > INFO  Service                        - Sync error occurred:
>> > >> > java.lang.OutOfMemoryError: Java heap space
>> > >> > java.lang.OutOfMemoryError: Java heap space
>> > >> >
>> > >> > WARN  JournalMessageStore            - Message could not be added
>> to
>> > >> long
>> > >> > term store: Java heap space
>> > >> > java.lang.OutOfMemoryError: Java heap space
>> > >> >
>> > >> >
>> > >> > I am running the activemq with -xms 256m -xmx1000m.
>> > >> > activemq.xml has
>> > >> >  <memoryManager>
>> > >> >         <usageManager id="memory-manager" limit="8048576000"/>
>> > >> >     </memoryManager>
>> > >> >
>> > >> > Why is the error coming ?
>> > >> > --
>> > >> > View this message in context:
>> > >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
>> > >> > Sent from the ActiveMQ - User forum at Nabble.com.
>> > >> >
>> > >> >
>> > >>
>> > >>
>> > >> --
>> > >>
>> > >> James
>> > >> -------
>> > >> http://radio.weblogs.com/0112098/
>> > >>
>> > >
>> > >
>> > > --
>> > >
>> > > James
>> > > -------
>> > > http://radio.weblogs.com/0112098/
>> > >
>> > >
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
>> > Sent from the ActiveMQ - User forum at Nabble.com.
>> >
>> >
>>
>>
>> --
>>
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5960761
Sent from the ActiveMQ - User forum at Nabble.com.


Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by pradeep <pr...@gmail.com>.
Thanks James. I forgot to mention that I have already switched to
JDBCpersistence 

<persistenceAdapter>
        <jdbcPersistenceAdapter dataSource="#oracle-ds"/>
 </persistenceAdapter>

I am using  -Xmx1000m  to set the heap size. I am monitoring the activemq
server using jprofier.
Shouldn't this heap size be enough for JBDC persistence ? I will try with
-Xmx200m and let you know the result.

Pradeep


James.Strachan wrote:
> 
> Incidentally you could disable the journal if you have limited RAM and
> are happy to trade performance for lower RAM usage...
> 
> use <jdbcPersistenceAdapter/> instead in your XML like this example
> 
> http://incubator.apache.org/activemq/jdbc-master-slave.html
> 
> its much slower but doesn't require messages to be kept in RAM until a
> checkpoint.
> 
> 
> On 8/24/06, James Strachan <ja...@gmail.com> wrote:
>> Are you sure you are definitely setting the Java heap size? e.g. its
>> usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do you
>> see it using up 1Gb of RAM when you only have a 100Mb usage manager
>> setting?
>>
>> Note that ActiveMQ uses a high performance journal so that messages
>> are only evicted from RAM when a checkpoint to JDBC occurs, not the
>> exact second that a message is consumed.
>>
>> So you are sending 1000 messages to 5 topics of 100K. So thats about
>> 500Mb of messages. So I'd try set your memoryManager to be 800mb and
>> your Java heap to be about 2000M and that should work - use JMX to see
>> how much memory its using and how many messages get sent to the
>> queues.
>>
>>
>> On 8/24/06, pradeep <pr...@gmail.com> wrote:
>> >
>> > Thanks James.
>> > I am using 4.0.1. I tried lowering the memory to 100MB. It did not
>> work.
>> > I increased the size to 400 MB, 800mb etc.
>> >
>> > It still gives me
>> > Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
>> > java.lang.OutOfMemoryError: Java heap space
>> >
>> > Why doesn't ActiveMQ remove the messages from memory when it has
>> already
>> > persisted messages into database. I am seeing  the memory problem in
>> > ActiveMQ and not other JMS server that I am evaluating.
>> > James, can you please help me here.
>> >
>> > Pradeep
>> >
>> >
>> > James.Strachan wrote:
>> > >
>> > > FWIW if you use ActiveMQ 4.1 you can configure the memory limit via
>> > >
>> > > <usageManager limitMb="100"/>
>> > >
>> > > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
>> > >> That memory limit looks a bit big; its about 7Gb I'd maybe set it to
>> > >> be around 100Mb insteead
>> > >>
>> > >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
>> > >> >
>> > >> > 1. Created  a durable subsriber for 5 different topics and
>> disonnected
>> > >> the
>> > >> > clients
>> > >> > 2. Tried to send 1000 messages to each topic (message size =100kb)
>> in
>> > >> > parallel
>> > >> >     5 threads were created each sending messages to different
>> topics
>> > >> >      (Separate connection Factory lookup and topic lookup)
>> > >> >     I got this error this
>> > >> >
>> > >> > INFO  Service                        - Sync error occurred:
>> > >> > java.lang.OutOfMemoryError: Java heap space
>> > >> > java.lang.OutOfMemoryError: Java heap space
>> > >> >
>> > >> > WARN  JournalMessageStore            - Message could not be added
>> to
>> > >> long
>> > >> > term store: Java heap space
>> > >> > java.lang.OutOfMemoryError: Java heap space
>> > >> >
>> > >> >
>> > >> > I am running the activemq with -xms 256m -xmx1000m.
>> > >> > activemq.xml has
>> > >> >  <memoryManager>
>> > >> >         <usageManager id="memory-manager" limit="8048576000"/>
>> > >> >     </memoryManager>
>> > >> >
>> > >> > Why is the error coming ?
>> > >> > --
>> > >> > View this message in context:
>> > >>
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
>> > >> > Sent from the ActiveMQ - User forum at Nabble.com.
>> > >> >
>> > >> >
>> > >>
>> > >>
>> > >> --
>> > >>
>> > >> James
>> > >> -------
>> > >> http://radio.weblogs.com/0112098/
>> > >>
>> > >
>> > >
>> > > --
>> > >
>> > > James
>> > > -------
>> > > http://radio.weblogs.com/0112098/
>> > >
>> > >
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
>> > Sent from the ActiveMQ - User forum at Nabble.com.
>> >
>> >
>>
>>
>> --
>>
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5960212
Sent from the ActiveMQ - User forum at Nabble.com.


Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by James Strachan <ja...@gmail.com>.
Incidentally you could disable the journal if you have limited RAM and
are happy to trade performance for lower RAM usage...

use <jdbcPersistenceAdapter/> instead in your XML like this example

http://incubator.apache.org/activemq/jdbc-master-slave.html

its much slower but doesn't require messages to be kept in RAM until a
checkpoint.


On 8/24/06, James Strachan <ja...@gmail.com> wrote:
> Are you sure you are definitely setting the Java heap size? e.g. its
> usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do you
> see it using up 1Gb of RAM when you only have a 100Mb usage manager
> setting?
>
> Note that ActiveMQ uses a high performance journal so that messages
> are only evicted from RAM when a checkpoint to JDBC occurs, not the
> exact second that a message is consumed.
>
> So you are sending 1000 messages to 5 topics of 100K. So thats about
> 500Mb of messages. So I'd try set your memoryManager to be 800mb and
> your Java heap to be about 2000M and that should work - use JMX to see
> how much memory its using and how many messages get sent to the
> queues.
>
>
> On 8/24/06, pradeep <pr...@gmail.com> wrote:
> >
> > Thanks James.
> > I am using 4.0.1. I tried lowering the memory to 100MB. It did not work.
> > I increased the size to 400 MB, 800mb etc.
> >
> > It still gives me
> > Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
> > java.lang.OutOfMemoryError: Java heap space
> >
> > Why doesn't ActiveMQ remove the messages from memory when it has already
> > persisted messages into database. I am seeing  the memory problem in
> > ActiveMQ and not other JMS server that I am evaluating.
> > James, can you please help me here.
> >
> > Pradeep
> >
> >
> > James.Strachan wrote:
> > >
> > > FWIW if you use ActiveMQ 4.1 you can configure the memory limit via
> > >
> > > <usageManager limitMb="100"/>
> > >
> > > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
> > >> That memory limit looks a bit big; its about 7Gb I'd maybe set it to
> > >> be around 100Mb insteead
> > >>
> > >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
> > >> >
> > >> > 1. Created  a durable subsriber for 5 different topics and disonnected
> > >> the
> > >> > clients
> > >> > 2. Tried to send 1000 messages to each topic (message size =100kb) in
> > >> > parallel
> > >> >     5 threads were created each sending messages to different topics
> > >> >      (Separate connection Factory lookup and topic lookup)
> > >> >     I got this error this
> > >> >
> > >> > INFO  Service                        - Sync error occurred:
> > >> > java.lang.OutOfMemoryError: Java heap space
> > >> > java.lang.OutOfMemoryError: Java heap space
> > >> >
> > >> > WARN  JournalMessageStore            - Message could not be added to
> > >> long
> > >> > term store: Java heap space
> > >> > java.lang.OutOfMemoryError: Java heap space
> > >> >
> > >> >
> > >> > I am running the activemq with -xms 256m -xmx1000m.
> > >> > activemq.xml has
> > >> >  <memoryManager>
> > >> >         <usageManager id="memory-manager" limit="8048576000"/>
> > >> >     </memoryManager>
> > >> >
> > >> > Why is the error coming ?
> > >> > --
> > >> > View this message in context:
> > >> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
> > >> > Sent from the ActiveMQ - User forum at Nabble.com.
> > >> >
> > >> >
> > >>
> > >>
> > >> --
> > >>
> > >> James
> > >> -------
> > >> http://radio.weblogs.com/0112098/
> > >>
> > >
> > >
> > > --
> > >
> > > James
> > > -------
> > > http://radio.weblogs.com/0112098/
> > >
> > >
> >
> > --
> > View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
> > Sent from the ActiveMQ - User forum at Nabble.com.
> >
> >
>
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by James Strachan <ja...@gmail.com>.
Are you sure you are definitely setting the Java heap size? e.g. its
usually -Xmx1000m not -xmx etc. If you watch the broker in JMX do you
see it using up 1Gb of RAM when you only have a 100Mb usage manager
setting?

Note that ActiveMQ uses a high performance journal so that messages
are only evicted from RAM when a checkpoint to JDBC occurs, not the
exact second that a message is consumed.

So you are sending 1000 messages to 5 topics of 100K. So thats about
500Mb of messages. So I'd try set your memoryManager to be 800mb and
your Java heap to be about 2000M and that should work - use JMX to see
how much memory its using and how many messages get sent to the
queues.


On 8/24/06, pradeep <pr...@gmail.com> wrote:
>
> Thanks James.
> I am using 4.0.1. I tried lowering the memory to 100MB. It did not work.
> I increased the size to 400 MB, 800mb etc.
>
> It still gives me
> Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
> java.lang.OutOfMemoryError: Java heap space
>
> Why doesn't ActiveMQ remove the messages from memory when it has already
> persisted messages into database. I am seeing  the memory problem in
> ActiveMQ and not other JMS server that I am evaluating.
> James, can you please help me here.
>
> Pradeep
>
>
> James.Strachan wrote:
> >
> > FWIW if you use ActiveMQ 4.1 you can configure the memory limit via
> >
> > <usageManager limitMb="100"/>
> >
> > On 8/23/06, James Strachan <ja...@gmail.com> wrote:
> >> That memory limit looks a bit big; its about 7Gb I'd maybe set it to
> >> be around 100Mb insteead
> >>
> >> On 8/23/06, pradeep <pr...@gmail.com> wrote:
> >> >
> >> > 1. Created  a durable subsriber for 5 different topics and disonnected
> >> the
> >> > clients
> >> > 2. Tried to send 1000 messages to each topic (message size =100kb) in
> >> > parallel
> >> >     5 threads were created each sending messages to different topics
> >> >      (Separate connection Factory lookup and topic lookup)
> >> >     I got this error this
> >> >
> >> > INFO  Service                        - Sync error occurred:
> >> > java.lang.OutOfMemoryError: Java heap space
> >> > java.lang.OutOfMemoryError: Java heap space
> >> >
> >> > WARN  JournalMessageStore            - Message could not be added to
> >> long
> >> > term store: Java heap space
> >> > java.lang.OutOfMemoryError: Java heap space
> >> >
> >> >
> >> > I am running the activemq with -xms 256m -xmx1000m.
> >> > activemq.xml has
> >> >  <memoryManager>
> >> >         <usageManager id="memory-manager" limit="8048576000"/>
> >> >     </memoryManager>
> >> >
> >> > Why is the error coming ?
> >> > --
> >> > View this message in context:
> >> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
> >> > Sent from the ActiveMQ - User forum at Nabble.com.
> >> >
> >> >
> >>
> >>
> >> --
> >>
> >> James
> >> -------
> >> http://radio.weblogs.com/0112098/
> >>
> >
> >
> > --
> >
> > James
> > -------
> > http://radio.weblogs.com/0112098/
> >
> >
>
> --
> View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by pradeep <pr...@gmail.com>.
Thanks James.
I am using 4.0.1. I tried lowering the memory to 100MB. It did not work.
I increased the size to 400 MB, 800mb etc.

It still gives me 
Exception in thread "ActiveMQ Transport: tcp:///127.0.0.1:3116"
java.lang.OutOfMemoryError: Java heap space

Why doesn't ActiveMQ remove the messages from memory when it has already
persisted messages into database. I am seeing  the memory problem in
ActiveMQ and not other JMS server that I am evaluating.
James, can you please help me here.

Pradeep


James.Strachan wrote:
> 
> FWIW if you use ActiveMQ 4.1 you can configure the memory limit via
> 
> <usageManager limitMb="100"/>
> 
> On 8/23/06, James Strachan <ja...@gmail.com> wrote:
>> That memory limit looks a bit big; its about 7Gb I'd maybe set it to
>> be around 100Mb insteead
>>
>> On 8/23/06, pradeep <pr...@gmail.com> wrote:
>> >
>> > 1. Created  a durable subsriber for 5 different topics and disonnected
>> the
>> > clients
>> > 2. Tried to send 1000 messages to each topic (message size =100kb) in
>> > parallel
>> >     5 threads were created each sending messages to different topics
>> >      (Separate connection Factory lookup and topic lookup)
>> >     I got this error this
>> >
>> > INFO  Service                        - Sync error occurred:
>> > java.lang.OutOfMemoryError: Java heap space
>> > java.lang.OutOfMemoryError: Java heap space
>> >
>> > WARN  JournalMessageStore            - Message could not be added to
>> long
>> > term store: Java heap space
>> > java.lang.OutOfMemoryError: Java heap space
>> >
>> >
>> > I am running the activemq with -xms 256m -xmx1000m.
>> > activemq.xml has
>> >  <memoryManager>
>> >         <usageManager id="memory-manager" limit="8048576000"/>
>> >     </memoryManager>
>> >
>> > Why is the error coming ?
>> > --
>> > View this message in context:
>> http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
>> > Sent from the ActiveMQ - User forum at Nabble.com.
>> >
>> >
>>
>>
>> --
>>
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5959137
Sent from the ActiveMQ - User forum at Nabble.com.


Re: INFO Service - Sync error occurred: java.lang.Ou

Posted by James Strachan <ja...@gmail.com>.
FWIW if you use ActiveMQ 4.1 you can configure the memory limit via

<usageManager limitMb="100"/>

On 8/23/06, James Strachan <ja...@gmail.com> wrote:
> That memory limit looks a bit big; its about 7Gb I'd maybe set it to
> be around 100Mb insteead
>
> On 8/23/06, pradeep <pr...@gmail.com> wrote:
> >
> > 1. Created  a durable subsriber for 5 different topics and disonnected the
> > clients
> > 2. Tried to send 1000 messages to each topic (message size =100kb) in
> > parallel
> >     5 threads were created each sending messages to different topics
> >      (Separate connection Factory lookup and topic lookup)
> >     I got this error this
> >
> > INFO  Service                        - Sync error occurred:
> > java.lang.OutOfMemoryError: Java heap space
> > java.lang.OutOfMemoryError: Java heap space
> >
> > WARN  JournalMessageStore            - Message could not be added to long
> > term store: Java heap space
> > java.lang.OutOfMemoryError: Java heap space
> >
> >
> > I am running the activemq with -xms 256m -xmx1000m.
> > activemq.xml has
> >  <memoryManager>
> >         <usageManager id="memory-manager" limit="8048576000"/>
> >     </memoryManager>
> >
> > Why is the error coming ?
> > --
> > View this message in context: http://www.nabble.com/INFO--Service--------------------------Sync-error-occurred%3A-java.lang.Ou-tf2152180.html#a5943593
> > Sent from the ActiveMQ - User forum at Nabble.com.
> >
> >
>
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


-- 

James
-------
http://radio.weblogs.com/0112098/