# Timeout on Elasticsearch

**URL:** <https://discuss.elastic.co/t/timeout-on-elasticsearch/54515>\
**Category:** Elasticsearch\
**Created:** [July 1, 2016, 8:09am UTC](https://discuss.elastic.co/t/timeout-on-elasticsearch/54515 "2016-07-01T08:09:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pittoch](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@pittoch](https://discuss.elastic.co/u/pittoch)\
**Post date:** [July 1, 2016, 8:09am UTC](https://discuss.elastic.co/t/timeout-on-elasticsearch/54515/1 "2016-07-01T08:09:18Z")

</div>

Hi,

I have every day timeout on plugin elasticsearch of 3000ms.  
In the log I see

```
[2016-07-01 09:43:16,311][WARN][indices.ttl] [Franklin Hall] failed to execute ttl purge
java.lang.OutOfMemoryError: Java heap space
[2016-07-01 09:43:16,311][WARN][threadpool] [Franklin Hall] failed to run org.elasticsearch.index.shard.IndexShard$EngineRefresher@672074
java.lang.OutOfMemoryError: Java heap space
[2016-07-01 09:43:42,982][WARN][netty.channel.socket.nio.AbstractNioSelector] Failed to accept a connection.
java.lang.OutOfMemoryError: Java heap space

```

So I want to increase heap size ([https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html))  
I put this command in /etc/init.d/elasticsearch

```
export ES_HEAP_SIZE=3g

```

My server have 8Gb of ram.  
If I put more than 3Gb, I have this error:

```
[root@x elasticsearch]# /etc/init.d/elasticsearch restart
Stopping elasticsearch: [OK]
Starting elasticsearch: Invalid initial heap size: -Xms4g
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit. [FAILED]

```

In kibana configuraiton, I have

```
 elasticsearch.pingTimeout: 5000
 elasticsearch.requestTimeout: 50000

```

Can you help me ?

Thanks

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [July 3, 2016, 10:59pm UTC](https://discuss.elastic.co/t/timeout-on-elasticsearch/54515/2 "2016-07-03T22:59:14Z")

</div>

I suspect that you're running a 32-bit JVM by default and that is leading to the error message that you're seeing. You can try forcing a 64-bit server JVM by adding the flags `-server -d64` to `ES_JAVA_OPTS` on startup.

---

<div class="post-metadata">

**Author:** ![pittoch](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@pittoch](https://discuss.elastic.co/u/pittoch)\
**Post date:** [July 4, 2016, 6:53am UTC](https://discuss.elastic.co/t/timeout-on-elasticsearch/54515/3 "2016-07-04T06:53:50Z")

</div>

Thanks!  
I use a 32bits version of java, so I reinstall it with a 64 bits versions.

---

<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 5, 2017, 10:38pm UTC](https://discuss.elastic.co/t/timeout-on-elasticsearch/54515/4 "2017-07-05T22:38:36Z")

</div>


