# OutOfMemoryError with RabbitMQ River

**URL:** <https://discuss.elastic.co/t/outofmemoryerror-with-rabbitmq-river/9348>\
**Category:** Elasticsearch\
**Created:** [October 13, 2012, 5:54pm UTC](https://discuss.elastic.co/t/outofmemoryerror-with-rabbitmq-river/9348 "2012-10-13T17:54:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cocowalla](https://avatars.discourse-cdn.com/v4/letter/c/e36b37/32.png) [@cocowalla](https://discuss.elastic.co/u/cocowalla)\
**Post date:** [October 13, 2012, 5:54pm UTC](https://discuss.elastic.co/t/outofmemoryerror-with-rabbitmq-river/9348/1 "2012-10-13T17:54:36Z")

</div>

I've been trying out the RabbitMQ river, but have quickly hit problems.

Here's what I am doing::

1. I sent 2,500 messages to RabbitMQ, each containing 100 documents in  
bulk api format
2. I create a RabbitMQ river using curl, with bulk size 1 (I tried 100  
first BTW, and got the same result)
3. About 40,000 documents get indexed OK by elasticsearch

elasticsearch them crashes with:

Exception in thread "elasticsearch[Nameless One][rabbitmq\_river][T#1]"

> java.lang.OutOfMemoryError: unable to create new native thread  
> at java.lang.Thread.start0(Native Method)  
> at java.lang.Thread.start(Thread.java:691)  
> at  
> java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:943)  
> ...  
> at  
> org.elasticsearch.river.rabbitmq.RabbitmqRiver$Consumer.run(RabbitmqRiver.java:291)

I'm running elasticsearch 0.19.10, with version 1.4.0 of the RabbitMQ  
river. The river I created is accessing a remote instance of RabbitMQ.

I've read in this group that others are using this river successfully, so  
was not expecting this - am I doing something wrong?

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:08am UTC](https://discuss.elastic.co/t/outofmemoryerror-with-rabbitmq-river/9348/2 "2017-07-06T03:08:57Z")

</div>

Closed on July 6, 2017, 3:08am UTC


