-
近期用java寫的email伺服器常出現broken pipe 錯誤。 經查驗
有可能是linux的線程機制會產生JVM出錯的問題,特別是在連接高峰期間經常出現這樣的問題,tomcat在linux下也出現類似情況。
解決方法是在環境變數中設定: _JAVA_SR_SIGNUM = 12 基本上就可以解決。
在WIN環境變數中設定: _JAVA_SR_SIGNUM =12, 若Linux下用export _JAVA_SR_SIGNUM =12, 基本上可以解決.
sun的解釋:
--posted by: cooper
Below is a clipping from Sun on working around JVM crashes under high
thread counts in the JVM 1.3 for Linux
On Linux, use a larger signal number for hotspot thread
suspension/resumption handler. The signal number being used is
specified by environment variable _JAVA_SR_SIGNUM. Setting it to a
number larger than SIGSEGV (11) will solve the problem. A good number
to use is 12, which is SIGUSR2. Using signal 16 to work around the
problem might have potential problems. So on tcsh, "setenv
_JAVA_SR_SIGNUM 12" can solve the problem.
-