comparison src/os/bsd/vm/os_bsd.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 252ad8d5f22b
children b9a918201d47 8be1318fbe77
comparison
equal deleted inserted replaced
8853:2e093b564241 8854:754c24457b20
163 return physical_memory() >> 2; 163 return physical_memory() >> 2;
164 } 164 }
165 165
166 julong os::physical_memory() { 166 julong os::physical_memory() {
167 return Bsd::physical_memory(); 167 return Bsd::physical_memory();
168 }
169
170 julong os::allocatable_physical_memory(julong size) {
171 #ifdef _LP64
172 return size;
173 #else
174 julong result = MIN2(size, (julong)3800*M);
175 if (!is_allocatable(result)) {
176 // See comments under solaris for alignment considerations
177 julong reasonable_size = (julong)2*G - 2 * os::vm_page_size();
178 result = MIN2(size, reasonable_size);
179 }
180 return result;
181 #endif // _LP64
182 } 168 }
183 169
184 //////////////////////////////////////////////////////////////////////////////// 170 ////////////////////////////////////////////////////////////////////////////////
185 // environment support 171 // environment support
186 172