java/lang/OutOfMemoryError":"Failed to fork OS thread请教

> OS Name:        AIX> OS Version:     5.3xms768mxmx1024mjavacore:heap space free: asfcfb58heap space allocated:30000000在运行一天左右,就会出现java/lang/OutOfMemoryError":"Failed to fork OS thread的异...显示全部
> OS Name:        AIX
> OS Version:     5.3

xms768m
xmx1024m

javacore:
heap space free: asfcfb58
heap space allocated:30000000

在运行一天左右,就会出现java/lang/OutOfMemoryError":"Failed to fork OS thread的异常,jvm打出一个core文件。这时,大部分线程将进入wait状态,导致很多业务不能运行,请教各位大侠是否遇到过同样的情况。
上周突然就这样了,之前一直也没有事。到底什么原因啊???收起
参与9

查看其它 7 个回答luckydevil_2001的回答

luckydevil_2001luckydevil_2001其它others
另一种可能:
The problems was solved setting Xmx parameters

for example, your OS has 3 gb RAM.
your java processs is -Xmx1440m, that means almost 1.5 gb .
ok. your process starts, it works for a while.... but at any moment after get that much memory it blows up saying Failed to fork OS thread.
that is because, at least in windows, allows you to allocate as max the half of memory for a process, but you are not counting on java overhead. Then, if it tries to get more "permitted" memory it will blow up because the OS is not allowing to create new threads.

my advice.

1. if you want to allocate a lot of memory, use 40% as max of the total RAM of the OS (in windows) using Xmx params.
2. also, tweak the parameter -XX:ThreadStackSize=128 to reduce it, the default is 512 and that is too much
互联网服务 · 2015-08-06
浏览1639

回答者

luckydevil_2001
其它others

luckydevil_2001 最近回答过的问题

回答状态

  • 发布时间:2015-08-06
  • 关注会员:1 人
  • 回答浏览:1639
  • X社区推广