JVM选项- xss -它到底做了什么?

时间:2022-11-07 17:21:44

It says here that -Xss is used to "set thread stack size", what does it mean exactly? Could anyone help me understand this?

这里说-Xss被用来“设置线程堆栈大小”,这到底意味着什么?有人能帮我理解一下吗?

4 个解决方案

#1


213  

Each thread in a Java application has its own stack. The stack is used to hold return addresses, function/method call arguments, etc. So if a thread tends to process large structures via recursive algorithms, it may need a large stack for all those return addresses and such. With the Sun JVM, you can set that size via that parameter.

Java应用程序中的每个线程都有自己的堆栈。堆栈用于保存返回地址、函数/方法调用参数等。因此,如果一个线程倾向于通过递归算法处理大型结构,那么它可能需要一个大堆栈来存放所有这些返回地址等。使用Sun JVM,您可以通过该参数设置该大小。

#2


123  

It indeed sets the stack size on a JVM.

它确实在JVM上设置堆栈大小。

You should touch it in either of these two situations:

你应该在这两种情况下触摸它:

  • *Error (the stack size is greater than the limit), increase the value
  • *Error(堆栈大小大于限制),增加值
  • OutOfMemoryError: unable to create new native thread (too many threads, each thread has a large stack), decrease it.
  • OutOfMemoryError:无法创建新的本机线程(太多的线程,每个线程都有一个大堆栈),请减少它。

The latter usually comes when your Xss is set too large - then you need to balance it (testing!)

后者通常在您的Xss设置得太大时出现——那么您需要平衡它(测试!)

#3


3  

Each thread has a stack which used for local variables and internal values. The stack size limits how deep your calls can be. Generally this is not something you need to change.

每个线程都有一个用于本地变量和内部值的堆栈。堆栈大小限制了调用的深度。通常这不是你需要改变的。

#4


3  

If I am not mistaken, this is what tells the JVM how much successive calls it will accept before issuing a *Error. Not something you wish to change generally.

如果我没有弄错,这就告诉JVM在发出*Error之前,它将接受多少后续调用。不是你想要改变的。

#1


213  

Each thread in a Java application has its own stack. The stack is used to hold return addresses, function/method call arguments, etc. So if a thread tends to process large structures via recursive algorithms, it may need a large stack for all those return addresses and such. With the Sun JVM, you can set that size via that parameter.

Java应用程序中的每个线程都有自己的堆栈。堆栈用于保存返回地址、函数/方法调用参数等。因此,如果一个线程倾向于通过递归算法处理大型结构,那么它可能需要一个大堆栈来存放所有这些返回地址等。使用Sun JVM,您可以通过该参数设置该大小。

#2


123  

It indeed sets the stack size on a JVM.

它确实在JVM上设置堆栈大小。

You should touch it in either of these two situations:

你应该在这两种情况下触摸它:

  • *Error (the stack size is greater than the limit), increase the value
  • *Error(堆栈大小大于限制),增加值
  • OutOfMemoryError: unable to create new native thread (too many threads, each thread has a large stack), decrease it.
  • OutOfMemoryError:无法创建新的本机线程(太多的线程,每个线程都有一个大堆栈),请减少它。

The latter usually comes when your Xss is set too large - then you need to balance it (testing!)

后者通常在您的Xss设置得太大时出现——那么您需要平衡它(测试!)

#3


3  

Each thread has a stack which used for local variables and internal values. The stack size limits how deep your calls can be. Generally this is not something you need to change.

每个线程都有一个用于本地变量和内部值的堆栈。堆栈大小限制了调用的深度。通常这不是你需要改变的。

#4


3  

If I am not mistaken, this is what tells the JVM how much successive calls it will accept before issuing a *Error. Not something you wish to change generally.

如果我没有弄错,这就告诉JVM在发出*Error之前,它将接受多少后续调用。不是你想要改变的。