# \[LogStash::Runner\] Logstash - java.lang.OutOfMemoryError: Java heap space

**URL:** <https://discuss.elastic.co/t/logstash-runner-logstash-java-lang-outofmemoryerror-java-heap-space/205881>\
**Category:** Logstash\
**Created:** [October 30, 2019, 2:34pm UTC](https://discuss.elastic.co/t/logstash-runner-logstash-java-lang-outofmemoryerror-java-heap-space/205881 "2019-10-30T14:34:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bharath\_Pusuluri](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@Bharath\_Pusuluri](https://discuss.elastic.co/u/Bharath_Pusuluri)\
**Post date:** [October 30, 2019, 2:34pm UTC](https://discuss.elastic.co/t/logstash-runner-logstash-java-lang-outofmemoryerror-java-heap-space/205881/1 "2019-10-30T14:34:03Z")

</div>

I am trying to run a Logstash service ingesting the data returning from curl command. Somehow, the Logstash is failing saying with the following warnings and errors.

I tried running the Logstash with option - LS\_HEAP\_SIZE=10g , but still it is failing. I think I am missing some setting here. Someone, please correct me.

java.lang.OutOfMemoryError: Java heap space  
Dumping heap to java\_pid3386315.hprof ...  
Heap dump file created [409899976 bytes in 1.626 secs]  
warning: thread "[main]\<exec" terminated with exception (report\_on\_exception is true):  
java.lang.OutOfMemoryError: Java heap space  
at java.nio.HeapCharBuffer.(HeapCharBuffer.java:57)  
at java.nio.CharBuffer.allocate(CharBuffer.java:335)  
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:810)  
at java.nio.charset.Charset.decode(Charset.java:807)  
at org.jruby.RubyEncoding.decodeUTF8(RubyEncoding.java:269)  
at org.jruby.runtime.Helpers.decodeByteList(Helpers.java:2439)  
at org.jruby.RubyString.decodeString(RubyString.java:797)  
at org.jruby.RubyString.toString(RubyString.java:788)  
at org.jruby.RubyString.asJavaString(RubyString.java:1338)  
at org.logstash.ext.JrubyEventExtLibrary$RubyEvent.ruby\_from\_json(JrubyEventExtLibrary.java:227)  
at org.logstash.ext.JrubyEventExtLibrary$RubyEvent$INVOKER$s$1$0$ruby\_from\_json.call(JrubyEventExtLibrary$RubyEvent$INVOKER$s$1$0$ruby\_from\_json.gen)  
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)  
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)  
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:317)  
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)  
at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)  
at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET\_METHOD(MixedModeIRMethod.java:171)  
at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:158)  
at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:90)  
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:357)  
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:182)  
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:339)  
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)  
at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)  
at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET\_METHOD(MixedModeIRMethod.java:171)  
at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:158)  
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:357)  
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:182)  
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:189)  
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:338)  
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)  
at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)  
warning: thread "[main]-pipeline-manager" terminated with exception (report\_on\_exception is true):  
java.lang.OutOfMemoryError: Java heap space  
at java.nio.HeapCharBuffer.(HeapCharBuffer.java:57)  
at java.nio.CharBuffer.allocate(CharBuffer.java:335)  
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:810)  
at java.nio.charset.Charset.decode(Charset.java:807)  
at org.jruby.RubyEncoding.decodeUTF8(RubyEncoding.java:269)  
at org.jruby.runtime.Helpers.decodeByteList(Helpers.java:2439)  
at org.jruby.RubyString.decodeString(RubyString.java:797)  
at org.jruby.RubyString.toString(RubyString.java:788)  
at org.jruby.RubyString.asJavaString(RubyString.java:1338)  
at org.logstash.ext.JrubyEventExtLibrary$RubyEvent.ruby\_from\_json(JrubyEventExtLibrary.java:227)  
at org.logstash.ext.JrubyEventExtLibrary$RubyEvent$INVOKER$s$1$0$ruby\_from\_json.call(JrubyEventExtLibrary$RubyEvent$INVOKER$s$1$0$ruby\_from\_json.gen)  
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)  
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)  
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:317)  
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)  
at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)  
at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET\_METHOD(MixedModeIRMethod.java:171)  
at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:158)  
at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:90)  
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:357)  
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:182)  
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:339)  
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)  
at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)  
at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET\_METHOD(MixedModeIRMethod.java:171)  
at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:158)  
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:357)  
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:182)  
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:189)  
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:338)  
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)  
at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)  
[ERROR] 2019-10-30 09:21:58.665 [LogStash::Runner] Logstash - java.lang.OutOfMemoryError: Java heap space

---

<div class="post-metadata">

**Author:** ![Bharath\_Pusuluri](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@Bharath\_Pusuluri](https://discuss.elastic.co/u/Bharath_Pusuluri)\
**Post date:** [October 30, 2019, 2:47pm UTC](https://discuss.elastic.co/t/logstash-runner-logstash-java-lang-outofmemoryerror-java-heap-space/205881/2 "2019-10-30T14:47:40Z")

</div>

/etc/logstash/jvm.options

I changed the value here and it worked.

---

<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:** [November 27, 2019, 2:47pm UTC](https://discuss.elastic.co/t/logstash-runner-logstash-java-lang-outofmemoryerror-java-heap-space/205881/3 "2019-11-27T14:47:41Z")

</div>

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