src/hotspot/share/memory/universe.cpp
branchepsilon-gc-branch
changeset 56422 b09629f4b243
parent 56406 e629240491c7
parent 49658 8237a91c1cca
child 56448 76d86de267b9
equal deleted inserted replaced
56407:dddf5c49f4fc 56422:b09629f4b243
    33 #include "code/codeCache.hpp"
    33 #include "code/codeCache.hpp"
    34 #include "code/dependencies.hpp"
    34 #include "code/dependencies.hpp"
    35 #include "gc/shared/cardTableBarrierSet.hpp"
    35 #include "gc/shared/cardTableBarrierSet.hpp"
    36 #include "gc/shared/collectedHeap.inline.hpp"
    36 #include "gc/shared/collectedHeap.inline.hpp"
    37 #include "gc/shared/gcArguments.hpp"
    37 #include "gc/shared/gcArguments.hpp"
    38 #include "gc/shared/gcLocker.inline.hpp"
    38 #include "gc/shared/gcConfig.hpp"
       
    39 #include "gc/shared/gcLocker.hpp"
    39 #include "gc/shared/generation.hpp"
    40 #include "gc/shared/generation.hpp"
    40 #include "gc/shared/gcTraceTime.inline.hpp"
    41 #include "gc/shared/gcTraceTime.inline.hpp"
    41 #include "gc/shared/space.hpp"
    42 #include "gc/shared/space.hpp"
    42 #include "interpreter/interpreter.hpp"
    43 #include "interpreter/interpreter.hpp"
    43 #include "logging/log.hpp"
    44 #include "logging/log.hpp"
   600   // never attempt to fill in the stack trace of preallocated errors that do not have
   601   // never attempt to fill in the stack trace of preallocated errors that do not have
   601   // backtrace. These errors are kept alive forever and may be "re-used" when all
   602   // backtrace. These errors are kept alive forever and may be "re-used" when all
   602   // preallocated errors with backtrace have been consumed. Also need to avoid
   603   // preallocated errors with backtrace have been consumed. Also need to avoid
   603   // a potential loop which could happen if an out of memory occurs when attempting
   604   // a potential loop which could happen if an out of memory occurs when attempting
   604   // to allocate the backtrace.
   605   // to allocate the backtrace.
   605   return ((throwable() != Universe::_out_of_memory_error_java_heap) &&
   606   return ((!oopDesc::equals(throwable(), Universe::_out_of_memory_error_java_heap)) &&
   606           (throwable() != Universe::_out_of_memory_error_metaspace)  &&
   607           (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_metaspace))  &&
   607           (throwable() != Universe::_out_of_memory_error_class_metaspace)  &&
   608           (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_class_metaspace))  &&
   608           (throwable() != Universe::_out_of_memory_error_array_size) &&
   609           (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_array_size)) &&
   609           (throwable() != Universe::_out_of_memory_error_gc_overhead_limit) &&
   610           (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_gc_overhead_limit)) &&
   610           (throwable() != Universe::_out_of_memory_error_realloc_objects));
   611           (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_realloc_objects)));
   611 }
   612 }
   612 
   613 
   613 
   614 
   614 oop Universe::gen_out_of_memory_error(oop default_err) {
   615 oop Universe::gen_out_of_memory_error(oop default_err) {
   615   // generate an out of memory error:
   616   // generate an out of memory error:
   743   return JNI_OK;
   744   return JNI_OK;
   744 }
   745 }
   745 
   746 
   746 CollectedHeap* Universe::create_heap() {
   747 CollectedHeap* Universe::create_heap() {
   747   assert(_collectedHeap == NULL, "Heap already created");
   748   assert(_collectedHeap == NULL, "Heap already created");
   748   assert(GCArguments::is_initialized(), "GC must be initialized here");
   749   return GCConfig::arguments()->create_heap();
   749   return GCArguments::arguments()->create_heap();
       
   750 }
   750 }
   751 
   751 
   752 // Choose the heap base address and oop encoding mode
   752 // Choose the heap base address and oop encoding mode
   753 // when compressed oops are used:
   753 // when compressed oops are used:
   754 // Unscaled  - Use 32-bits oops without encoding when
   754 // Unscaled  - Use 32-bits oops without encoding when
   763   if (status != JNI_OK) {
   763   if (status != JNI_OK) {
   764     return status;
   764     return status;
   765   }
   765   }
   766   log_info(gc)("Using %s", _collectedHeap->name());
   766   log_info(gc)("Using %s", _collectedHeap->name());
   767 
   767 
   768   GCArguments::arguments()->post_heap_initialize();
       
   769   ThreadLocalAllocBuffer::set_max_size(Universe::heap()->max_tlab_size());
   768   ThreadLocalAllocBuffer::set_max_size(Universe::heap()->max_tlab_size());
   770 
   769 
   771 #ifdef _LP64
   770 #ifdef _LP64
   772   if (UseCompressedOops) {
   771   if (UseCompressedOops) {
   773     // Subtract a page because something can get allocated at heap base.
   772     // Subtract a page because something can get allocated at heap base.