IBM Support

Understanding java.lang.StackOverflowError and why it occurs.

Question & Answer


Question

Understanding java.lang.StackOverflowError and why it occurs.

Answer

What is java.lang.StackOverflowError?

System may face a java.lang.StackOverflowError if it reaches the maximum allowable stack limit.
a.     JVM hits this exception when -Xss value is set to a small value.
b.     The method call depth is very deep (for example, in the Create Wave agent, the depth of the wave optimizer call is roughly equal to the number of shipments assigned to a shipment group).
c.     The stack frame is very large.
 
What is -Xss value?
 
-Xss, a java argument controls the size of a thread stack. Every method call creates and pushes a stack frame on to the thread’s stack. The stack frame contains, at the minimum, the method’s local variables and the method arguments.
 
What are the current recommendations for -Xss for SSCA?
 
Currently the recommendations (as shown below) are specific only to create waves or batch waves agent.
Shipment Lines per Shipment                     Stack Size
Group      
4k                                                                          2MB
10k                                                                        4MB
15k                                                                        6MB
20k                                                                        8MB
25k                                                                      10MB
 
What are the factors to consider when deciding the -Xss value for APPSERVER JVMs?
 
There are no specific recommendations (it is implementation specific, depends on the available memory, number of concurrent threads etc) for the other AGENT/APPSERVER JVMs. However, bumping up the stack size to 1 MB has helped some of the customers in reducing StackOverflowError.
While recommending the stack size for APPSERVER, one should keep in mind that there will be more threads and setting a high -Xss may result in native out of the memory in some cases. 

[{"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

FAQ3456

Document Information

Modified date:
11 February 2020

UID

swg21518558