src/os/posix/vm/os_posix.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8026324.01 Sdiff src/os/posix/vm

src/os/posix/vm/os_posix.cpp

Print this page




 219   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
 220   else st->print("%uk", rlim.rlim_cur >> 10);
 221   st->cr();
 222 }
 223 
 224 void os::Posix::print_uname_info(outputStream* st) {
 225   // kernel
 226   st->print("uname:");
 227   struct utsname name;
 228   uname(&name);
 229   st->print("%s ", name.sysname);
 230 #ifdef ASSERT
 231   st->print("%s ", name.nodename);
 232 #endif
 233   st->print("%s ", name.release);
 234   st->print("%s ", name.version);
 235   st->print("%s", name.machine);
 236   st->cr();
 237 }
 238 







 239 bool os::has_allocatable_memory_limit(julong* limit) {
 240   struct rlimit rlim;
 241   int getrlimit_res = getrlimit(RLIMIT_AS, &rlim);
 242   // if there was an error when calling getrlimit, assume that there is no limitation
 243   // on virtual memory.
 244   bool result;
 245   if ((getrlimit_res != 0) || (rlim.rlim_cur == RLIM_INFINITY)) {
 246     result = false;
 247   } else {
 248     *limit = (julong)rlim.rlim_cur;
 249     result = true;
 250   }
 251 #ifdef _LP64
 252   return result;
 253 #else
 254   // arbitrary virtual space limit for 32 bit Unices found by testing. If
 255   // getrlimit above returned a limit, bound it with this limit. Otherwise
 256   // directly use it.
 257   const julong max_virtual_limit = (julong)3800*M;
 258   if (result) {




 219   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
 220   else st->print("%uk", rlim.rlim_cur >> 10);
 221   st->cr();
 222 }
 223 
 224 void os::Posix::print_uname_info(outputStream* st) {
 225   // kernel
 226   st->print("uname:");
 227   struct utsname name;
 228   uname(&name);
 229   st->print("%s ", name.sysname);
 230 #ifdef ASSERT
 231   st->print("%s ", name.nodename);
 232 #endif
 233   st->print("%s ", name.release);
 234   st->print("%s ", name.version);
 235   st->print("%s", name.machine);
 236   st->cr();
 237 }
 238 
 239 #ifndef PRODUCT
 240 bool os::get_host_name(char* buf, size_t buflen) {
 241   // could use uname as in above also
 242   return (gethostname(buf, buflen) != -1);
 243 }
 244 #endif // PRODUCT
 245 
 246 bool os::has_allocatable_memory_limit(julong* limit) {
 247   struct rlimit rlim;
 248   int getrlimit_res = getrlimit(RLIMIT_AS, &rlim);
 249   // if there was an error when calling getrlimit, assume that there is no limitation
 250   // on virtual memory.
 251   bool result;
 252   if ((getrlimit_res != 0) || (rlim.rlim_cur == RLIM_INFINITY)) {
 253     result = false;
 254   } else {
 255     *limit = (julong)rlim.rlim_cur;
 256     result = true;
 257   }
 258 #ifdef _LP64
 259   return result;
 260 #else
 261   // arbitrary virtual space limit for 32 bit Unices found by testing. If
 262   // getrlimit above returned a limit, bound it with this limit. Otherwise
 263   // directly use it.
 264   const julong max_virtual_limit = (julong)3800*M;
 265   if (result) {


src/os/posix/vm/os_posix.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File