< prev index next >

src/hotspot/share/gc/shared/collectedHeap.inline.hpp

Print this page
rev 49521 : [mq]: heap8


 137     return NULL;  // caller does a CHECK_0 too
 138   }
 139 
 140   HeapWord* result = NULL;
 141   if (UseTLAB) {
 142     result = allocate_from_tlab(klass, THREAD, size);
 143     if (result != NULL) {
 144       assert(!HAS_PENDING_EXCEPTION,
 145              "Unexpected exception, will result in uninitialized storage");
 146       return result;
 147     }
 148   }
 149   bool gc_overhead_limit_was_exceeded = false;
 150   result = Universe::heap()->mem_allocate(size,
 151                                           &gc_overhead_limit_was_exceeded);
 152   if (result != NULL) {
 153     NOT_PRODUCT(Universe::heap()->
 154       check_for_non_bad_heap_word_value(result, size));
 155     assert(!HAS_PENDING_EXCEPTION,
 156            "Unexpected exception, will result in uninitialized storage");
 157     THREAD->incr_allocated_bytes(size * HeapWordSize);

 158 
 159     AllocTracer::send_allocation_outside_tlab(klass, result, size * HeapWordSize, THREAD);
 160 



 161     return result;
 162   }
 163 
 164 
 165   if (!gc_overhead_limit_was_exceeded) {
 166     // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support
 167     report_java_out_of_memory("Java heap space");
 168 
 169     if (JvmtiExport::should_post_resource_exhausted()) {
 170       JvmtiExport::post_resource_exhausted(
 171         JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR | JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP,
 172         "Java heap space");
 173     }
 174 
 175     THROW_OOP_0(Universe::out_of_memory_error_java_heap());
 176   } else {
 177     // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support
 178     report_java_out_of_memory("GC overhead limit exceeded");
 179 
 180     if (JvmtiExport::should_post_resource_exhausted()) {




 137     return NULL;  // caller does a CHECK_0 too
 138   }
 139 
 140   HeapWord* result = NULL;
 141   if (UseTLAB) {
 142     result = allocate_from_tlab(klass, THREAD, size);
 143     if (result != NULL) {
 144       assert(!HAS_PENDING_EXCEPTION,
 145              "Unexpected exception, will result in uninitialized storage");
 146       return result;
 147     }
 148   }
 149   bool gc_overhead_limit_was_exceeded = false;
 150   result = Universe::heap()->mem_allocate(size,
 151                                           &gc_overhead_limit_was_exceeded);
 152   if (result != NULL) {
 153     NOT_PRODUCT(Universe::heap()->
 154       check_for_non_bad_heap_word_value(result, size));
 155     assert(!HAS_PENDING_EXCEPTION,
 156            "Unexpected exception, will result in uninitialized storage");
 157     int size_in_bytes = size * HeapWordSize;
 158     THREAD->incr_allocated_bytes(size_in_bytes);
 159 
 160     AllocTracer::send_allocation_outside_tlab(klass, result, size_in_bytes, THREAD);
 161 
 162     if (ThreadHeapSampler::enabled()) {
 163       THREAD->heap_sampler().check_for_sampling(result, size_in_bytes);
 164     }
 165     return result;
 166   }
 167 
 168 
 169   if (!gc_overhead_limit_was_exceeded) {
 170     // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support
 171     report_java_out_of_memory("Java heap space");
 172 
 173     if (JvmtiExport::should_post_resource_exhausted()) {
 174       JvmtiExport::post_resource_exhausted(
 175         JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR | JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP,
 176         "Java heap space");
 177     }
 178 
 179     THROW_OOP_0(Universe::out_of_memory_error_java_heap());
 180   } else {
 181     // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support
 182     report_java_out_of_memory("GC overhead limit exceeded");
 183 
 184     if (JvmtiExport::should_post_resource_exhausted()) {


< prev index next >