Yes, you can do that. Basically, you can configure the max Stack size of your thread in your application.
For this, you can use the option named ss
to adjust the maximum stack size. A VM option is usually passed using -X{option}
. So you can use java -Xss1M
to set the maximum of stack size to 1M
.
One more example is java -Xss1048576
, this sets the max thread size to approximately 1 MB
Checkout the two below blogs also for more info and other flags.
-> https://www.baeldung.com/jvm-configure-stack-sizes
-> https://docs.gigaspaces.com/latest/production/production-jvm-tuning.html
CLICK HERE to find out more related problems solutions.