< prev index next >

src/hotspot/share/memory/filemap.cpp

Print this page
rev 51611 : 8214118: HeapRegions marked as archive even if CDS mapping fails
Reviewed-by: tschatzl, jiangli

*** 972,990 **** char* base = os::map_memory(_fd, _full_path, si->_file_offset, addr, regions[i].byte_size(), si->_read_only, si->_allow_exec); if (base == NULL || base != addr) { // dealloc the regions from java heap ! dealloc_archive_heap_regions(regions, region_num); log_info(cds)("UseSharedSpaces: Unable to map at required address in java heap."); return false; } } if (!verify_mapped_heap_regions(first, region_num)) { // dealloc the regions from java heap ! dealloc_archive_heap_regions(regions, region_num); log_info(cds)("UseSharedSpaces: mapped heap regions are corrupt"); return false; } // the shared heap data is mapped successfully --- 972,990 ---- char* base = os::map_memory(_fd, _full_path, si->_file_offset, addr, regions[i].byte_size(), si->_read_only, si->_allow_exec); if (base == NULL || base != addr) { // dealloc the regions from java heap ! dealloc_archive_heap_regions(regions, region_num, is_open_archive); log_info(cds)("UseSharedSpaces: Unable to map at required address in java heap."); return false; } } if (!verify_mapped_heap_regions(first, region_num)) { // dealloc the regions from java heap ! dealloc_archive_heap_regions(regions, region_num, is_open_archive); log_info(cds)("UseSharedSpaces: mapped heap regions are corrupt"); return false; } // the shared heap data is mapped successfully
*** 1018,1031 **** num_open_archive_heap_ranges); } } // dealloc the archive regions from java heap ! void FileMapInfo::dealloc_archive_heap_regions(MemRegion* regions, int num) { if (num > 0) { assert(regions != NULL, "Null archive ranges array with non-zero count"); ! G1CollectedHeap::heap()->dealloc_archive_regions(regions, num); } } #endif // INCLUDE_CDS_JAVA_HEAP bool FileMapInfo::verify_region_checksum(int i) { --- 1018,1031 ---- num_open_archive_heap_ranges); } } // dealloc the archive regions from java heap ! void FileMapInfo::dealloc_archive_heap_regions(MemRegion* regions, int num, bool is_open) { if (num > 0) { assert(regions != NULL, "Null archive ranges array with non-zero count"); ! G1CollectedHeap::heap()->dealloc_archive_regions(regions, num, is_open); } } #endif // INCLUDE_CDS_JAVA_HEAP bool FileMapInfo::verify_region_checksum(int i) {
*** 1256,1266 **** } } // Dealloc the archive heap regions only without unmapping. The regions are part // of the java heap. Unmapping of the heap regions are managed by GC. map_info->dealloc_archive_heap_regions(open_archive_heap_ranges, ! num_open_archive_heap_ranges); ! map_info->dealloc_archive_heap_regions(string_ranges, num_string_ranges); } else if (DumpSharedSpaces) { fail_stop("%s", msg); } } --- 1256,1269 ---- } } // Dealloc the archive heap regions only without unmapping. The regions are part // of the java heap. Unmapping of the heap regions are managed by GC. map_info->dealloc_archive_heap_regions(open_archive_heap_ranges, ! num_open_archive_heap_ranges, ! true); ! map_info->dealloc_archive_heap_regions(string_ranges, ! num_string_ranges, ! false); } else if (DumpSharedSpaces) { fail_stop("%s", msg); } }
< prev index next >