# Heap Size in Logstash

**URL:** <https://discuss.elastic.co/t/heap-size-in-logstash/115872>\
**Category:** Logstash\
**Created:** [January 17, 2018, 11:38am UTC](https://discuss.elastic.co/t/heap-size-in-logstash/115872 "2018-01-17T11:38:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![devil\_srj7](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@devil\_srj7](https://discuss.elastic.co/u/devil_srj7)\
**Post date:** [January 17, 2018, 11:38am UTC](https://discuss.elastic.co/t/heap-size-in-logstash/115872/1 "2018-01-17T11:38:37Z")

</div>

While importing the table of size 9 GB in elasticsearch through Logstash i get the following error.

```
[2018-01-17T16:34:59,948][INFO][logstash.inputs.jdbc] (120.731000s) SELECT * from mis_monthly_work_statistics
[2018-01-17T16:34:59,963][WARN][logstash.inputs.jdbc] Exception when executing JDBC query {:exception=>#<Sequel::DatabaseError: Java::JavaLang::OutOfMemoryError: Java heap space>}
Error: Your application used more memory than the safety cap of 1G.
Specify -J-Xmx####M to increase it (#### = cap size in MB).
Specify -w for full java.lang.OutOfMemoryError: Java heap space stack trace

```

I have tried specifying -Xms & -Xmx in JVM option but an error is recieved as

```
Invalid initial heap size: -Xms12g
The specified size exceeds the maximum representable size.
JVM creation failed 

```

I have also tried declaring LS\_HEAP\_SIZE=" -Xmx12g -Xms12g" in startup-options still no difference.

---

<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:** [February 14, 2018, 11:38am UTC](https://discuss.elastic.co/t/heap-size-in-logstash/115872/2 "2018-02-14T11:38:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
