src/os/bsd/vm/os_bsd.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8025942 Cdiff src/os/bsd/vm/os_bsd.cpp

src/os/bsd/vm/os_bsd.cpp

Print this page

        

*** 155,167 **** julong os::available_memory() { return Bsd::available_memory(); } julong os::Bsd::available_memory() { ! // XXXBSD: this is just a stopgap implementation ! return physical_memory() >> 2; } julong os::physical_memory() { return Bsd::physical_memory(); } --- 155,176 ---- julong os::available_memory() { return Bsd::available_memory(); } + // available here means free julong os::Bsd::available_memory() { ! uint64_t available = physical_memory() >> 2; ! #ifdef __APPLE__ ! mach_msg_type_number_t count = HOST_VM_INFO64_COUNT; ! vm_statistics64_data_t vmstat; ! kern_return_t kerr = host_statistics64(mach_host_self(), HOST_VM_INFO64, (host_info64_t)&vmstat, &count); ! if (kerr == KERN_SUCCESS) { ! available = vmstat.free_count * os::vm_page_size(); ! } ! #endif ! return available; } julong os::physical_memory() { return Bsd::physical_memory(); }
src/os/bsd/vm/os_bsd.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File