Mercurial > hg > graal-compiler
comparison src/os/solaris/vm/os_solaris.cpp @ 8854:754c24457b20
7112912: Message "Error occurred during initialization of VM" on boxes with lots of RAM
Summary: Ergonomics now also takes available virtual memory into account when deciding for a heap size. The helper method to determine the maximum allocatable memory block now uses the appropriate OS specific calls to retrieve available virtual memory for the java process. In 32 bit environments this method now also searches for the maximum actually reservable amount of memory. Merge previously separate implementations for Linux/BSD/Solaris into a single method.
Reviewed-by: jmasa, tamao
author | tschatzl |
---|---|
date | Wed, 27 Mar 2013 19:21:18 +0100 |
parents | 15401203db6b |
children | b9a918201d47 8be1318fbe77 |
comparison
equal
deleted
inserted
replaced
8853:2e093b564241 | 8854:754c24457b20 |
---|---|
472 | 472 |
473 julong os::Solaris::_physical_memory = 0; | 473 julong os::Solaris::_physical_memory = 0; |
474 | 474 |
475 julong os::physical_memory() { | 475 julong os::physical_memory() { |
476 return Solaris::physical_memory(); | 476 return Solaris::physical_memory(); |
477 } | |
478 | |
479 julong os::allocatable_physical_memory(julong size) { | |
480 #ifdef _LP64 | |
481 return size; | |
482 #else | |
483 julong result = MIN2(size, (julong)3835*M); | |
484 if (!is_allocatable(result)) { | |
485 // Memory allocations will be aligned but the alignment | |
486 // is not known at this point. Alignments will | |
487 // be at most to LargePageSizeInBytes. Protect | |
488 // allocations from alignments up to illegal | |
489 // values. If at this point 2G is illegal. | |
490 julong reasonable_size = (julong)2*G - 2 * LargePageSizeInBytes; | |
491 result = MIN2(size, reasonable_size); | |
492 } | |
493 return result; | |
494 #endif | |
495 } | 477 } |
496 | 478 |
497 static hrtime_t first_hrtime = 0; | 479 static hrtime_t first_hrtime = 0; |
498 static const hrtime_t hrtime_hz = 1000*1000*1000; | 480 static const hrtime_t hrtime_hz = 1000*1000*1000; |
499 const int LOCK_BUSY = 1; | 481 const int LOCK_BUSY = 1; |