comparison src/share/vm/runtime/virtualspace.cpp @ 10969:a837fa3d3f86

8013057: assert(_needs_gc || SafepointSynchronize::is_at_safepoint()) failed: only read at safepoint Summary: Detect mmap() commit failures in Linux and Solaris os::commit_memory() impls and call vm_exit_out_of_memory(). Add os::commit_memory_or_exit(). Also tidy up some NMT accounting and some mmap() return value checking. Reviewed-by: zgu, stefank, dholmes, dsamersoff
author dcubed
date Thu, 13 Jun 2013 11:16:38 -0700
parents b294421fa3c5
children 4c84d351cca9 bdd155477289
comparison
equal deleted inserted replaced
10405:f2110083203d 10969:a837fa3d3f86
531 if (lower_needs > 0) { 531 if (lower_needs > 0) {
532 assert(low_boundary() <= lower_high() && 532 assert(low_boundary() <= lower_high() &&
533 lower_high() + lower_needs <= lower_high_boundary(), 533 lower_high() + lower_needs <= lower_high_boundary(),
534 "must not expand beyond region"); 534 "must not expand beyond region");
535 if (!os::commit_memory(lower_high(), lower_needs, _executable)) { 535 if (!os::commit_memory(lower_high(), lower_needs, _executable)) {
536 debug_only(warning("os::commit_memory failed")); 536 debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
537 ", lower_needs=" SIZE_FORMAT ", %d) failed",
538 lower_high(), lower_needs, _executable);)
537 return false; 539 return false;
538 } else { 540 } else {
539 _lower_high += lower_needs; 541 _lower_high += lower_needs;
540 } 542 }
541 } 543 }
542 if (middle_needs > 0) { 544 if (middle_needs > 0) {
543 assert(lower_high_boundary() <= middle_high() && 545 assert(lower_high_boundary() <= middle_high() &&
544 middle_high() + middle_needs <= middle_high_boundary(), 546 middle_high() + middle_needs <= middle_high_boundary(),
545 "must not expand beyond region"); 547 "must not expand beyond region");
546 if (!os::commit_memory(middle_high(), middle_needs, middle_alignment(), 548 if (!os::commit_memory(middle_high(), middle_needs, middle_alignment(),
547 _executable)) { 549 _executable)) {
548 debug_only(warning("os::commit_memory failed")); 550 debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
551 ", middle_needs=" SIZE_FORMAT ", " SIZE_FORMAT
552 ", %d) failed", middle_high(), middle_needs,
553 middle_alignment(), _executable);)
549 return false; 554 return false;
550 } 555 }
551 _middle_high += middle_needs; 556 _middle_high += middle_needs;
552 } 557 }
553 if (upper_needs > 0) { 558 if (upper_needs > 0) {
554 assert(middle_high_boundary() <= upper_high() && 559 assert(middle_high_boundary() <= upper_high() &&
555 upper_high() + upper_needs <= upper_high_boundary(), 560 upper_high() + upper_needs <= upper_high_boundary(),
556 "must not expand beyond region"); 561 "must not expand beyond region");
557 if (!os::commit_memory(upper_high(), upper_needs, _executable)) { 562 if (!os::commit_memory(upper_high(), upper_needs, _executable)) {
558 debug_only(warning("os::commit_memory failed")); 563 debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
564 ", upper_needs=" SIZE_FORMAT ", %d) failed",
565 upper_high(), upper_needs, _executable);)
559 return false; 566 return false;
560 } else { 567 } else {
561 _upper_high += upper_needs; 568 _upper_high += upper_needs;
562 } 569 }
563 } 570 }