Not sure why you're getting the OOME even after increasing the JVM's heap
size. But given that you're potentially creating up to 20,000 topics, would
the use of message selectors be a more efficient approach?     

Joe


neowill wrote:
> 
> Thanks Dave!
> 
> I increase the JVM heap size by change activemq.bat:
> "%_JAVACMD%" -Xmx1000M %SUNJMX% %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS%
> %SSL_OPTS% -Dactivemq.classpath="%ACTIVEMQ_CLASSPATH%"
> -Dactivemq.home="%ACTIVEMQ_HOME%" -Dactivemq.base="%ACTIVEMQ_BASE%" -jar
> "%ACTIVEMQ_HOME%/bin/run.jar" start %*
> 
> but when i run the producer to create 2000 topics within one session. I
> still got the OOME. I wonder how much memory I should increase to support
> creating 2000 topics?
> 
> The application I am making is to constantly publish data for more than
> 20,000 different subjects and many consumers will subscribe to some of
> those which are interesting. thereby the straightforward way is to create
> that amount of topics in ActiveMQ. And those consumers just need to listen
> to the topics they are interested.   
> 
> Br,
> 
> 
> Dave Stanley wrote:
>> 
>> You can change the the maximum heap size for the JVM by tweaking the -Xmx
>> setting in <ActiveMQ>/bin/activemq.bat. There will be a memory and
>> processing overhead for each topic you create. Is it possible to reduce
>> the
>> number of Topics and just send more messages to each Topic?
>> 
>> Regards,
>> /Dave
>> On Tue, Jun 17, 2008 at 9:56 AM, neowill <[EMAIL PROTECTED]> wrote:
>> 
>>>
>>> Hi everyone,
>>>
>>> I am hoping someone might give me an idea how to deal with this issue:
>>>
>>> I am running ActiveMQ 5.1.0 on a Windows XP desktop, java version 1.5.0,
>>> default setting from the ActiveMQ download package.
>>> I change the example source ProducerTool.java from creating one topic
>>> and
>>> send 2000 message to creating 2000 topics and send 1 message for each
>>> topic.
>>> And then I got the OOME.
>>>
>>> basicly in the producerTool, I have one connection, one session. 2000
>>> topics..... cannot ActiveMQ support that? How to increase the capability
>>> of
>>> ActiveMQ to create as many topics as I want, like 20,000?
>>>
>>> Thanks in advance!!
>>>
>>> java.lang.OutOfMemoryError: Java heap space
>>>        at
>>>
>>> org.apache.activemq.util.DataByteArrayOutputStream.<init>(DataByteArrayOutputStream.java:45)
>>>        at
>>> org.apache.activemq.kaha.impl.index.hash.HashIndex.load(HashIndex.java:198)
>>>        at
>>>
>>> org.apache.activemq.kaha.impl.container.MapContainerImpl.load(MapContainerImpl.java:103)
>>>        at
>>>
>>> org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter.getSubsMapContainer(KahaPersistenceAdapter.java:222)
>>>        at
>>>
>>> org.apache.activemq.store.kahadaptor.KahaReferenceStoreAdapter.createTopicReferenceStore(KahaReferenceStoreAdapter.java:169)
>>>        at
>>>
>>> org.apache.activemq.store.amq.AMQPersistenceAdapter.createTopicMessageStore(AMQPersistenceAdapter.java:454)
>>>        at
>>>
>>> org.apache.activemq.broker.region.DestinationFactoryImpl.createDestination(DestinationFactoryImpl.java:94)
>>>        at
>>>
>>> org.apache.activemq.broker.region.AbstractRegion.createDestination(AbstractRegion.java:425)
>>>        at
>>>
>>> org.apache.activemq.broker.jmx.ManagedTopicRegion.createDestination(ManagedTopicRegion.java:56)
>>>        at
>>>
>>> org.apache.activemq.broker.region.AbstractRegion.addDestination(AbstractRegion.java:120)
>>>        at
>>>
>>> org.apache.activemq.broker.region.RegionBroker.addDestination(RegionBroker.java:266)
>>>        at
>>>
>>> org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:141)
>>>        at
>>>
>>> org.apache.activemq.advisory.AdvisoryBroker.addDestination(AdvisoryBroker.java:147)
>>>        at
>>>
>>> org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:141)
>>>        at
>>>
>>> org.apache.activemq.broker.MutableBrokerFilter.addDestination(MutableBrokerFilter.java:148)
>>>        at
>>> org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:425)
>>>        at
>>>
>>> org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.java:224)
>>>        at
>>> org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:125)
>>>        at
>>>
>>> org.apache.activemq.broker.CompositeDestinationBroker.send(CompositeDestinationBroker.java:95)
>>>        at
>>>
>>> org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:132)
>>>        at
>>>
>>> org.apache.activemq.broker.TransportConnection.processMessage(TransportConnection.java:437)
>>>        at
>>> org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:624)
>>>        at
>>>
>>> org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292)
>>>        at
>>>
>>> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:180)
>>>        at
>>>
>>> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
>>>        at
>>>
>>> org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:143)
>>>        at
>>>
>>> org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:206)
>>>        at
>>>
>>> org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
>>>        at
>>> org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:196)
>>>        at
>>> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:183)
>>>        at java.lang.Thread.run(Thread.java:595)
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/how-many-topics-can-I-create-in-a-broker-before-getting-OutOfMemoryError%3A-Java-heap-space-tp17905477p17905477.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/how-many-topics-can-I-create-in-a-broker-before-getting-OutOfMemoryError%3A-Java-heap-space-tp17905477p17932864.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to