< prev index next >

src/os/aix/vm/os_aix.cpp

Print this page




1538   st->print(", AS ");
1539   getrlimit(RLIMIT_AS, &rlim);
1540   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
1541   else st->print("%uk", rlim.rlim_cur >> 10);
1542 
1543   // Print limits on DATA, because it limits the C-heap.
1544   st->print(", DATA ");
1545   getrlimit(RLIMIT_DATA, &rlim);
1546   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
1547   else st->print("%uk", rlim.rlim_cur >> 10);
1548   st->cr();
1549 
1550   // load average
1551   st->print("load average:");
1552   double loadavg[3] = {-1.L, -1.L, -1.L};
1553   os::loadavg(loadavg, 3);
1554   st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]);
1555   st->cr();
1556 }
1557 





1558 void os::print_memory_info(outputStream* st) {
1559 
1560   st->print_cr("Memory:");
1561 
1562   st->print_cr("  default page size: %s", describe_pagesize(os::vm_page_size()));
1563   st->print_cr("  default stack page size: %s", describe_pagesize(os::vm_page_size()));
1564   st->print_cr("  default shm page size: %s", describe_pagesize(os::Aix::shm_default_page_size()));
1565   st->print_cr("  can use 64K pages dynamically: %s", (os::Aix::can_use_64K_pages() ? "yes" :"no"));
1566   st->print_cr("  can use 16M pages dynamically: %s", (os::Aix::can_use_16M_pages() ? "yes" :"no"));
1567   if (g_multipage_error != 0) {
1568     st->print_cr("  multipage error: %d", g_multipage_error);
1569   }
1570 
1571   // print out LDR_CNTRL because it affects the default page sizes
1572   const char* const ldr_cntrl = ::getenv("LDR_CNTRL");
1573   st->print_cr("  LDR_CNTRL=%s.", ldr_cntrl ? ldr_cntrl : "<unset>");
1574 
1575   const char* const extshm = ::getenv("EXTSHM");
1576   st->print_cr("  EXTSHM=%s.", extshm ? extshm : "<unset>");
1577 


2774     use_mmap = true;
2775   }
2776 
2777   char* addr = NULL;
2778   if (use_mmap) {
2779     addr = reserve_mmaped_memory(bytes, requested_addr);
2780   } else {
2781     // shmat: wish address is mandatory, and do not try 16M pages here.
2782     shmatted_memory_info_t info;
2783     const int flags = RESSHM_WISHADDR_OR_FAIL;
2784     if (reserve_shmatted_memory(bytes, requested_addr, flags, &info)) {
2785       addr = info.addr;
2786     }
2787   }
2788 
2789   return addr;
2790 }
2791 
2792 size_t os::read(int fd, void *buf, unsigned int nBytes) {
2793   return ::read(fd, buf, nBytes);




2794 }
2795 
2796 #define NANOSECS_PER_MILLISEC 1000000
2797 
2798 int os::sleep(Thread* thread, jlong millis, bool interruptible) {
2799   assert(thread == Thread::current(), "thread consistency check");
2800 
2801   // Prevent nasty overflow in deadline calculation
2802   // by handling long sleeps similar to solaris or windows.
2803   const jlong limit = INT_MAX;
2804   int result;
2805   while (millis > limit) {
2806     if ((result = os::sleep(thread, limit, interruptible)) != OS_OK) {
2807       return result;
2808     }
2809     millis -= limit;
2810   }
2811 
2812   ParkEvent * const slp = thread->_SleepEvent;
2813   slp->reset();




1538   st->print(", AS ");
1539   getrlimit(RLIMIT_AS, &rlim);
1540   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
1541   else st->print("%uk", rlim.rlim_cur >> 10);
1542 
1543   // Print limits on DATA, because it limits the C-heap.
1544   st->print(", DATA ");
1545   getrlimit(RLIMIT_DATA, &rlim);
1546   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
1547   else st->print("%uk", rlim.rlim_cur >> 10);
1548   st->cr();
1549 
1550   // load average
1551   st->print("load average:");
1552   double loadavg[3] = {-1.L, -1.L, -1.L};
1553   os::loadavg(loadavg, 3);
1554   st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]);
1555   st->cr();
1556 }
1557 
1558 int os::get_loaded_modules_info(os::LoadedModulesCallbackFunc callback, void *param) {
1559   // Not yet implemented.
1560   return 0;
1561 }
1562 
1563 void os::print_memory_info(outputStream* st) {
1564 
1565   st->print_cr("Memory:");
1566 
1567   st->print_cr("  default page size: %s", describe_pagesize(os::vm_page_size()));
1568   st->print_cr("  default stack page size: %s", describe_pagesize(os::vm_page_size()));
1569   st->print_cr("  default shm page size: %s", describe_pagesize(os::Aix::shm_default_page_size()));
1570   st->print_cr("  can use 64K pages dynamically: %s", (os::Aix::can_use_64K_pages() ? "yes" :"no"));
1571   st->print_cr("  can use 16M pages dynamically: %s", (os::Aix::can_use_16M_pages() ? "yes" :"no"));
1572   if (g_multipage_error != 0) {
1573     st->print_cr("  multipage error: %d", g_multipage_error);
1574   }
1575 
1576   // print out LDR_CNTRL because it affects the default page sizes
1577   const char* const ldr_cntrl = ::getenv("LDR_CNTRL");
1578   st->print_cr("  LDR_CNTRL=%s.", ldr_cntrl ? ldr_cntrl : "<unset>");
1579 
1580   const char* const extshm = ::getenv("EXTSHM");
1581   st->print_cr("  EXTSHM=%s.", extshm ? extshm : "<unset>");
1582 


2779     use_mmap = true;
2780   }
2781 
2782   char* addr = NULL;
2783   if (use_mmap) {
2784     addr = reserve_mmaped_memory(bytes, requested_addr);
2785   } else {
2786     // shmat: wish address is mandatory, and do not try 16M pages here.
2787     shmatted_memory_info_t info;
2788     const int flags = RESSHM_WISHADDR_OR_FAIL;
2789     if (reserve_shmatted_memory(bytes, requested_addr, flags, &info)) {
2790       addr = info.addr;
2791     }
2792   }
2793 
2794   return addr;
2795 }
2796 
2797 size_t os::read(int fd, void *buf, unsigned int nBytes) {
2798   return ::read(fd, buf, nBytes);
2799 }
2800 
2801 size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
2802   return ::pread(fd, buf, nBytes, offset);
2803 }
2804 
2805 #define NANOSECS_PER_MILLISEC 1000000
2806 
2807 int os::sleep(Thread* thread, jlong millis, bool interruptible) {
2808   assert(thread == Thread::current(), "thread consistency check");
2809 
2810   // Prevent nasty overflow in deadline calculation
2811   // by handling long sleeps similar to solaris or windows.
2812   const jlong limit = INT_MAX;
2813   int result;
2814   while (millis > limit) {
2815     if ((result = os::sleep(thread, limit, interruptible)) != OS_OK) {
2816       return result;
2817     }
2818     millis -= limit;
2819   }
2820 
2821   ParkEvent * const slp = thread->_SleepEvent;
2822   slp->reset();


< prev index next >