The config/jvm.options file allows defining JVM settings like Xmx for Logstash.
The same settings are also used for the plugin manager and other tools like the logstash-keystore, which can be problematic.
And example of this is that, if Xmx is set to 8gb on a 16gb RAM machine, starting the logstash-keystore while Logstash is running will need to allocate 16gb of RAM (a bit more in reality), which will cause the second execution to terminate with a "failed to reserve memory" error.
The current workaround is to run these tools with "LS_JAVA_OPTS" environment variable, which will override the existing settings. In the case of Xmx, you can do LS_JAVA_OPTS="-Xmx512m" bin/logstash-keystore <..>