< prev index next >

src/hotspot/share/utilities/vmError.cpp

Print this page




1548   static char buffer[O_BUFLEN];
1549 
1550   tty->print_cr("#");
1551   tty->print_cr("# java.lang.OutOfMemoryError: %s", _message);
1552   tty->print_cr("# -XX:OnOutOfMemoryError=\"%s\"", OnOutOfMemoryError);
1553 
1554   // make heap parsability
1555   Universe::heap()->ensure_parsability(false);  // no need to retire TLABs
1556 
1557   char* cmd;
1558   const char* ptr = OnOutOfMemoryError;
1559   while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){
1560     tty->print("#   Executing ");
1561 #if defined(LINUX)
1562     tty->print  ("/bin/sh -c ");
1563 #elif defined(SOLARIS)
1564     tty->print  ("/usr/bin/sh -c ");
1565 #endif
1566     tty->print_cr("\"%s\"...", cmd);
1567 
1568     if (os::fork_and_exec(cmd) < 0) {
1569       tty->print_cr("os::fork_and_exec failed: %s (%s=%d)",
1570                      os::strerror(errno), os::errno_name(errno), errno);
1571     }
1572   }
1573 }
1574 
1575 void VMError::report_java_out_of_memory(const char* message) {
1576   if (OnOutOfMemoryError && OnOutOfMemoryError[0]) {
1577     MutexLocker ml(Heap_lock);
1578     VM_ReportJavaOutOfMemory op(message);
1579     VMThread::execute(&op);
1580   }
1581 }
1582 
1583 void VMError::show_message_box(char *buf, int buflen) {
1584   bool yes;
1585   do {
1586     error_string(buf, buflen);
1587     yes = os::start_debugging(buf,buflen);
1588   } while (yes);




1548   static char buffer[O_BUFLEN];
1549 
1550   tty->print_cr("#");
1551   tty->print_cr("# java.lang.OutOfMemoryError: %s", _message);
1552   tty->print_cr("# -XX:OnOutOfMemoryError=\"%s\"", OnOutOfMemoryError);
1553 
1554   // make heap parsability
1555   Universe::heap()->ensure_parsability(false);  // no need to retire TLABs
1556 
1557   char* cmd;
1558   const char* ptr = OnOutOfMemoryError;
1559   while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){
1560     tty->print("#   Executing ");
1561 #if defined(LINUX)
1562     tty->print  ("/bin/sh -c ");
1563 #elif defined(SOLARIS)
1564     tty->print  ("/usr/bin/sh -c ");
1565 #endif
1566     tty->print_cr("\"%s\"...", cmd);
1567 
1568     if (os::fork_and_exec(cmd, true) < 0) {
1569       tty->print_cr("os::fork_and_exec failed: %s (%s=%d)",
1570                      os::strerror(errno), os::errno_name(errno), errno);
1571     }
1572   }
1573 }
1574 
1575 void VMError::report_java_out_of_memory(const char* message) {
1576   if (OnOutOfMemoryError && OnOutOfMemoryError[0]) {
1577     MutexLocker ml(Heap_lock);
1578     VM_ReportJavaOutOfMemory op(message);
1579     VMThread::execute(&op);
1580   }
1581 }
1582 
1583 void VMError::show_message_box(char *buf, int buflen) {
1584   bool yes;
1585   do {
1586     error_string(buf, buflen);
1587     yes = os::start_debugging(buf,buflen);
1588   } while (yes);


< prev index next >