StackOverflowError in JBoss EAP 7 with a custom worker pool stack-size
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 7
Issue
-
We moved from JDK 8 to JDK 11 and our application is failing when trying to access a web jsp with a java.lang.StackOverflowError after modifying the worker-pool stack-size
<subsystem xmlns="urn:jboss:domain:io:3.0"> <worker name="default" io-threads="2" task-max-threads="10" stack-size="32"/> <buffer-pool name="default"/> </subsystem>
Resolution
-
Remove the stack-size set in the io subsystem worker so the JVM level stack size applies or set it to a value that can handle the stack (at least 262144 should be set for a reasonable size)
-
EAP 7.3.5+ will log a warning if the stack-size is set lower than 100,000 bytes
This content is not included.JBEAP-20154 - WARN if user tries to set unrealistic io subsystem stack-size
Related Solutions
Root Cause
- The stack-size is in bytes, 32 bytes is not enough stack size to run.
- The default stack size is typically 512k or 1M for 64 bit JDKs.
- The stack-size is Content from docs.oracle.com is not included.just a suggestion, which the JVM may choose to ignore. JDK 8 seems to ignore the request to set the stack size so low, but JDK 11 is honoring the request resulting in the issue.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.