2

I switched to the Azul JVM in order to use a native ARM JVM and Solr was no longer able to start up. I started seeing a new error in the log:

The stack size specified is too small, Specify at least 384k

If I switch back to the Oracle jvm I do not get this error.

2 Answers 2

4

Requirements for stack size appears to be different between ARM and x86 JVMs.

The relevant lines setting the default in bin/solr is:

# Pick default for Java thread stack size, and then add to SOLR_OPTS
if [ -z ${SOLR_JAVA_STACK_SIZE+x} ]; then
  SOLR_JAVA_STACK_SIZE='-Xss256k'
fi
SOLR_OPTS+=($SOLR_JAVA_STACK_SIZE)

The default is too small for the ARM JVM to start up. To increase the stack size add the following line to bin/solr.in.cmd

SOLR_JAVA_STACK_SIZE='-Xss512k'
2
  • 512k still was not enough for me on OpenJDK. I checked the JVMs default value via java -XX:+PrintFlagsFinal -version | grep ThreadStackSize (the result does not contain a multiplier value, so 2048 means 2048k ) and put that value into the solr script. Worked like a charm from there on. Mar 8, 2022 at 10:47
  • 1
    As I was using Apple M1 chipset with Monterey, I had to add SOLR_JAVA_STACK_SIZE value to the file solr.in.sh instead of solr.in.cmd.
    – jbr.swork
    Mar 25, 2022 at 13:38
1

I faced the same error when trying to start Solr for my Rails app. After a lot of digging, I fixed it by adding the following line to my .zshrc file.

export _JAVA_OPTIONS='-Xss512k'

My use case:

macOS Monterey (M1 2020)

openjdk version "1.8.0_332"
OpenJDK Runtime Environment (Zulu 8.62.0.19-CA-macos-aarch64) (build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (Zulu 8.62.0.19-CA-macos-aarch64) (build 25.332-b09, mixed mode)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.