hotspot/src/share/vm/utilities/vmError.cpp
void VM_ReportJavaOutOfMemory::doit() {
{- -------------------------------------------
(1) (変数宣言など)
---------------------------------------- -}
// Don't allocate large buffer on stack
static char buffer[O_BUFLEN];
{- -------------------------------------------
(1) (トレース出力)
---------------------------------------- -}
tty->print_cr("#");
tty->print_cr("# java.lang.OutOfMemoryError: %s", _err->message());
tty->print_cr("# -XX:OnOutOfMemoryError=\"%s\"", OnOutOfMemoryError);
{- -------------------------------------------
(1) #TODO
---------------------------------------- -}
// make heap parsability
Universe::heap()->ensure_parsability(false); // no need to retire TLABs
{- -------------------------------------------
(1) OnOutOfMemoryError オプションに指定されているコマンドを
全て os::fork_and_exec() によって実行する.
---------------------------------------- -}
char* cmd;
const char* ptr = OnOutOfMemoryError;
while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){
tty->print("# Executing ");
#if defined(LINUX)
tty->print ("/bin/sh -c ");
#elif defined(SOLARIS)
tty->print ("/usr/bin/sh -c ");
#endif
tty->print_cr("\"%s\"...", cmd);
os::fork_and_exec(cmd);
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.