在jboss的run.bat中设置JAVA_OPTS
set JAVA_OPTS=-Xms256m -Xmx512m -Djava.awt.headless=true -XX:MaxPermSize=256m -server
这个参数在 jboss 的 run.bat 中有效,但因为我想增加堆栈大小,所以我添加了 -XSS512米 但它不起作用。
set JAVA_OPTS=-Xms256m -Xss512m -Xmx512m -Djava.awt.headless=true -XX:MaxPermSize=256m -server
这有什么问题吗?
set JAVA_OPTS=-Xms256m -Xmx512m -Djava.awt.headless=true -XX:MaxPermSize=256m -server
This argument works in run.bat of jboss but as i want to increase stack size i have added
-Xss512m
but it's not working.
set JAVA_OPTS=-Xms256m -Xss512m -Xmx512m -Djava.awt.headless=true -XX:MaxPermSize=256m -server
What is wrong in it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
-Xss512m
选项将每个线程堆栈的大小增加到 512 MB。太疯狂了。我预计这会导致 JBoss 内存不足。首先为什么要增加堆栈大小?默认堆栈大小应该适合大多数用途。如果它不够大,那么很可能是:
您的程序中存在导致无限递归的错误(并且增加堆栈大小无济于事)或。 ..
你正在使用一种算法,该算法具有一种病态的情况(并且增加堆栈大小是bandaid)。
根据您的评论,我猜测您正在使用正则表达式来解析包含多个记录的整个输入文档。正则表达式引擎使用递归来处理重复元素/组。
假设这就是问题所在,那么修复方法就是重写您的解析代码。
The
-Xss512m
option increases the size of every thread stack to 512 Mbytes. That's crazy. I expect that this is causing JBoss to run out of memory.Why are you increasing the stack size in the first place? The default stack size should be fine for most purposes. If it isn't big enough then there's a good chance that either:
you have a bug in your program that is causing infinite recursion (and increasing the stack size won't help) or ...
you are using an algorithm that has a pathological case (and increasing the stack size is a bandaid).
Based on your comments, I'd guess that you are using a regex to parse an entire input document containing multiple records. The regex engine uses recursion to deal with repeating elements / groups.
Assuming that this is the problem, then the fix is to rewrite your parsing code.
虚拟机中的每个线程都有一个堆栈。堆栈大小将限制您可以拥有的线程数量,堆栈大小太大,您将耗尽内存,因为每个线程分配的内存多于其所需的内存。 source
显然
-Xss512m
也是大的。尝试更小的值,更小:-Xss2048k
Each thread in the VM get's a stack. The stack size will limit the number of threads that you can have, too big of a stack size and you will run out of memory as each thread is allocated more memory than it needs. source
Clearly
-Xss512m
is too big. Try smaller values, much smaller:-Xss2048k