Logstash Too small initial heap

Team,

I have installed logstash 2.2 on my AWS linux instance .

When I executed the command to test the config file: service logstash configtest I get the heap error as below,
[root@ip-10-34-77-105 conf.d]# service logstash configtest
Error occurred during initialization of VM
Too small initial heap

I ran the below commands to set JAVA options. But no hope :frowning:
export _JAVA_OPTIONS="-Xmx2048m -Xms1024m"

I increased xmx and xms up to 4096m, but still end up in same error.

Please advice.

Team,

Additional info.
My AWS instance memory is 8GB and 2 CPUs (m4.large). Please suggest.

Try setting them in LS_JAVA_OPTS at the beginning of the line, or exporting the env variable. Also, you can try JAVA_OPTS.

@theuntergeek Thanks for reply. Could you please guide on how to set the parameter. I tried

export LS_JAVA_OPTS "-Xmx2048m -Xms1024m" , but getting export: `-Xmx2048m -Xms1024m': not a valid identifier

Try: export LS_JAVA_OPTS="-Xmx2048m -Xms1024m"

The equals sign is important.

Yes I tried with = as well :frowning: but i see same error

[root@ip-10-34-77-105 init.d]# export LS_JAVA_OPTS= "-Xmx2048m -Xms1024m"
bash: export: `-Xmx2048m -Xms1024m': not a valid identifier

There's a space after the = in your example.

Thanks a lot for support. Even after setting the same I getting heap error.
root@ip-10-34-70-115 init.d]# export LS_JAVA_OPTS="-Xmx2048m -Xms1024m"
[root@ip-10-34-70-115 init.d]# service logstash configtest
Error occurred during initialization of VM
Too small initial heap
[root@ip-10-34-77-105 init.d]# export LS_JAVA_OPTS="-Xmx2048m -Xms2048m"
[root@ip-10-34-77-105 init.d]# service logstash configtest
Error occurred during initialization of VM
Too small initial heap
[root@ip-10-34-77-105 init.d]# export JAVA_OPTS="-Xmx4096m -Xms4096m"
[root@ip-10-34-77-105 init.d]# service logstash configtest
Error occurred during initialization of VM
Too small initial heap

Here I was, thinking you were launching Logstash from the command line.

Put the JVM settings in /etc/sysconfig/logstash or /etc/default/logstash depending on which one your system uses.

I did try with this option as well. But still no hopes.

Alternatively I created m4.xlarge instance in AWS(4 cpus and 16gb memory) and installed Logstash there. But even there I get same error.

I meant that you should put LS_JAVA_OPTS="-Xmx2048m -Xms2048m" in /etc/default/logstash or /etc/sysconfig/logstash, not just the JVM options themselves.

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