Hi

I logged a ticket to improve this
https://issues.apache.org/jira/browse/CAMEL-6372

Then you can use maxMessagesPerPoll=1000 etc to cap at most 1000
entries per poll to avoid the OOME

On Thu, May 16, 2013 at 11:03 AM, matt.u <mattu...@gmail.com> wrote:
> Camel KratiConsumer throw OutOfMemory like this:
> Consumer Consumer[krati://notifications?operation=CamelKratiDelete] failed
> polling endpoint:
> Endpoint[krati://notifications?operation=CamelKratiDelete]. Will try again
> at next poll. Caused by: [java.lang.OutOfMemoryError - Java heap space]
> java.lang.OutOfMemoryError: Java heap space
>         at java.util.ArrayList.<init>(ArrayList.java:112)
>         at
> krati.store.DefaultDataStoreHandler.extractKeys(DefaultDataStoreHandler.java:226)
>         at 
> krati.store.DataStoreKeyIterator.findNext(DataStoreKeyIterator.java:82)
>         at 
> krati.store.DataStoreKeyIterator.hasNext(DataStoreKeyIterator.java:52)
>         at
> krati.store.ObjectStoreKeyIterator.hasNext(ObjectStoreKeyIterator.java:43)
>         at
> org.apache.camel.component.krati.KratiConsumer.poll(KratiConsumer.java:58)
>
> I think the problem is KratiConsumer.poll():
> Iterator keyIterator = dataStore.keyIterator();
>         while (keyIterator.hasNext()) {* //It's no limit, so use many
> memory*
>             Object key = keyIterator.next();
>             Object value = dataStore.get(key);
>             Exchange exchange = endpoint.createExchange();
>             exchange.setProperty(KratiConstants.KEY, key);
>             exchange.getIn().setBody(value);
>             queue.add(exchange);
>         }
>         return queue.isEmpty() ? 0 : processBatch(CastUtils.cast(queue));
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-KratiConsumer-throw-OutOfMemory-tp5732669.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to