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

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

/etc/logstash/jvm.options

I changed the value here and it worked.

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