Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/heapRegion.cpp @ 1718:bb847e31b836
6974928: G1: sometimes humongous objects are allocated in young regions
Summary: as the title says, sometimes we are allocating humongous objects in young regions and we shouldn't.
Reviewed-by: ysr, johnc
author | tonyp |
---|---|
date | Tue, 17 Aug 2010 14:40:00 -0400 |
parents | 2d160770d2e5 |
children | 72a161e62cc4 |
comparison
equal
deleted
inserted
replaced
1717:688c3755d7af | 1718:bb847e31b836 |
---|---|
788 HeapWord* p = bottom(); | 788 HeapWord* p = bottom(); |
789 HeapWord* prev_p = NULL; | 789 HeapWord* prev_p = NULL; |
790 int objs = 0; | 790 int objs = 0; |
791 int blocks = 0; | 791 int blocks = 0; |
792 VerifyLiveClosure vl_cl(g1, use_prev_marking); | 792 VerifyLiveClosure vl_cl(g1, use_prev_marking); |
793 bool is_humongous = isHumongous(); | |
794 size_t object_num = 0; | |
793 while (p < top()) { | 795 while (p < top()) { |
794 size_t size = oop(p)->size(); | 796 size_t size = oop(p)->size(); |
797 if (is_humongous != g1->isHumongous(size)) { | |
798 gclog_or_tty->print_cr("obj "PTR_FORMAT" is of %shumongous size (" | |
799 SIZE_FORMAT" words) in a %shumongous region", | |
800 p, g1->isHumongous(size) ? "" : "non-", | |
801 size, is_humongous ? "" : "non-"); | |
802 *failures = true; | |
803 } | |
804 object_num += 1; | |
795 if (blocks == BLOCK_SAMPLE_INTERVAL) { | 805 if (blocks == BLOCK_SAMPLE_INTERVAL) { |
796 HeapWord* res = block_start_const(p + (size/2)); | 806 HeapWord* res = block_start_const(p + (size/2)); |
797 if (p != res) { | 807 if (p != res) { |
798 gclog_or_tty->print_cr("offset computation 1 for "PTR_FORMAT" and " | 808 gclog_or_tty->print_cr("offset computation 1 for "PTR_FORMAT" and " |
799 SIZE_FORMAT" returned "PTR_FORMAT, | 809 SIZE_FORMAT" returned "PTR_FORMAT, |
855 *failures = true; | 865 *failures = true; |
856 return; | 866 return; |
857 } | 867 } |
858 } | 868 } |
859 | 869 |
870 if (is_humongous && object_num > 1) { | |
871 gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] is humongous " | |
872 "but has "SIZE_FORMAT", objects", | |
873 bottom(), end(), object_num); | |
874 *failures = true; | |
875 } | |
876 | |
860 if (p != top()) { | 877 if (p != top()) { |
861 gclog_or_tty->print_cr("end of last object "PTR_FORMAT" " | 878 gclog_or_tty->print_cr("end of last object "PTR_FORMAT" " |
862 "does not match top "PTR_FORMAT, p, top()); | 879 "does not match top "PTR_FORMAT, p, top()); |
863 *failures = true; | 880 *failures = true; |
864 return; | 881 return; |