< prev index next >

src/hotspot/os/linux/os_linux.cpp

Print this page
rev 52626 : webrev.03


5050   // call to exit(3C). There can be only 32 of these functions registered
5051   // and atexit() does not set errno.
5052 
5053   if (PerfAllowAtExitRegistration) {
5054     // only register atexit functions if PerfAllowAtExitRegistration is set.
5055     // atexit functions can be delayed until process exit time, which
5056     // can be problematic for embedded VM situations. Embedded VMs should
5057     // call DestroyJavaVM() to assure that VM resources are released.
5058 
5059     // note: perfMemory_exit_helper atexit function may be removed in
5060     // the future if the appropriate cleanup code can be added to the
5061     // VM_Exit VMOperation's doit method.
5062     if (atexit(perfMemory_exit_helper) != 0) {
5063       warning("os::init_2 atexit(perfMemory_exit_helper) failed");
5064     }
5065   }
5066 
5067   // initialize thread priority policy
5068   prio_init();
5069 
5070   if (!FLAG_IS_DEFAULT(AllocateHeapAt)) {
5071     set_coredump_filter(false /*largepages*/, true /*dax_shared*/);
5072   }
5073   return JNI_OK;
5074 }
5075 
5076 // Mark the polling page as unreadable
5077 void os::make_polling_page_unreadable(void) {
5078   if (!guard_memory((char*)_polling_page, Linux::page_size())) {
5079     fatal("Could not disable polling page");
5080   }
5081 }
5082 
5083 // Mark the polling page as readable
5084 void os::make_polling_page_readable(void) {
5085   if (!linux_mprotect((char *)_polling_page, Linux::page_size(), PROT_READ)) {
5086     fatal("Could not enable polling page");
5087   }
5088 }
5089 
5090 // older glibc versions don't have this macro (which expands to




5050   // call to exit(3C). There can be only 32 of these functions registered
5051   // and atexit() does not set errno.
5052 
5053   if (PerfAllowAtExitRegistration) {
5054     // only register atexit functions if PerfAllowAtExitRegistration is set.
5055     // atexit functions can be delayed until process exit time, which
5056     // can be problematic for embedded VM situations. Embedded VMs should
5057     // call DestroyJavaVM() to assure that VM resources are released.
5058 
5059     // note: perfMemory_exit_helper atexit function may be removed in
5060     // the future if the appropriate cleanup code can be added to the
5061     // VM_Exit VMOperation's doit method.
5062     if (atexit(perfMemory_exit_helper) != 0) {
5063       warning("os::init_2 atexit(perfMemory_exit_helper) failed");
5064     }
5065   }
5066 
5067   // initialize thread priority policy
5068   prio_init();
5069 
5070   if (!FLAG_IS_DEFAULT(AllocateHeapAt) || !FLAG_IS_DEFAULT(AllocateOldGenAt)) {
5071     set_coredump_filter(false /*largepages*/, true /*dax_shared*/);
5072   }
5073   return JNI_OK;
5074 }
5075 
5076 // Mark the polling page as unreadable
5077 void os::make_polling_page_unreadable(void) {
5078   if (!guard_memory((char*)_polling_page, Linux::page_size())) {
5079     fatal("Could not disable polling page");
5080   }
5081 }
5082 
5083 // Mark the polling page as readable
5084 void os::make_polling_page_readable(void) {
5085   if (!linux_mprotect((char *)_polling_page, Linux::page_size(), PROT_READ)) {
5086     fatal("Could not enable polling page");
5087   }
5088 }
5089 
5090 // older glibc versions don't have this macro (which expands to


< prev index next >