Signals used by the JVM

The following Table below shows the signals that are used by the JVM. The signals have been grouped in the table by type or use, as follows:

  • Exceptions: The operating system synchronously raises an appropriate exception signal whenever a fatal condition occurs.
  • Errors: The JVM raises a SIGABRT if it detects a condition from which it cannot recover.
  • Interrupts: Interrupt signals are raised asynchronously, from outside a JVM process, to request shutdown.
  • Controls: Other signals that are used by the JVM for control purposes.
Table 2. Signals used by the JVM
Signal Name Signal type Description Disabled by -Xrs
SIGSEGV Exception Incorrect access to memory (write to inaccessible memory) No
SIGILL Exception Illegal instruction (attempt to invoke an unknown machine instruction) No
SIGFPE Exception Floating point exception (divide by zero) No
SIGBUS Exception Bus error (attempt to address nonexistent memory location) Yes
SIGSYS Exception Bad system call issued Yes
SIGXCPU Exception CPU time limit exceeded (you have been running too long) Yes
SIGXFSZ Exception File size limit exceeded Yes
SIGEMT Exception EMT instruction (AIX specific) Yes
SIGABRT Error Abnormal termination. The JVM raises this signal whenever it detects a JVM fault. Yes
SIGINT Interrupt Interactive attention (CTRL-C). JVM exits normally. Yes
SIGTERM Interrupt Termination request. JVM will exit normally. Yes
SIGHUP Interrupt Hang up. JVM exits normally. Yes
SIGQUIT Control A quit signal for a terminal. JVM uses this for taking Javadumps. Yes
SIGTRAP Control Internal for use by DBX or ptrace. Used by some JVMs for internal control purposes. No
SIGPIPE Control A write to a pipe that is not being read. JVM ignores this. No
No Name (40)   An AIX reserved signal. Used by the AIX JVM for internal control purposes. No

Use the -Xrs (reduce signal usage) option to prevent the JVM from handling most signals. For more information, see Sun's Java application launcher page athttp://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html.

Do not use the -qflttrap C compiler setting because it provides the possibility of SIGTRAPs being generated, which might then impact the JIT. If you want to have floating point exceptions generated, include this call in your code:

fp_trap( FP_TRAP_SYNC)

so that it generates a SIGFPE signal.

If you install a signal handler for signal numbers 5 (SIGTRAP) or 40, you impact JVM performance because these signals are used for internal control purposes.

Signals 1 (SIGHUP), 2 (SIGINT), 4 (SIGILL), 6 (SIGABRT), 7 (SIGEMT), 8 (SIGFPE), 10 (SIGBUS), 11 (SIGSEGV), 12 (SIGSYS), 15 (SIGTERM), 24 (SIGXCPU) , and 25 (SIGXFSZ) cause the JVM to shut down; therefore, an application signal handler must not attempt to recover from these unless it no longer requires the services of the JVM.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26651/viewspace-751660/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26651/viewspace-751660/

你可能感兴趣的:(java)