src/share/vm/memory/universe.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/memory

src/share/vm/memory/universe.cpp

Print this page




 748     }
 749   }
 750 #endif
 751 
 752   assert(is_ptr_aligned((char*)base, alignment), "Must be");
 753   return (char*)base; // also return NULL (don't care) for 32-bit VM
 754 }
 755 
 756 jint Universe::initialize_heap() {
 757 
 758   if (UseParallelGC) {
 759 #if INCLUDE_ALL_GCS
 760     Universe::_collectedHeap = new ParallelScavengeHeap();
 761 #else  // INCLUDE_ALL_GCS
 762     fatal("UseParallelGC not supported in this VM.");
 763 #endif // INCLUDE_ALL_GCS
 764 
 765   } else if (UseG1GC) {
 766 #if INCLUDE_ALL_GCS
 767     G1CollectorPolicy* g1p = new G1CollectorPolicy();

 768     G1CollectedHeap* g1h = new G1CollectedHeap(g1p);
 769     Universe::_collectedHeap = g1h;
 770 #else  // INCLUDE_ALL_GCS
 771     fatal("UseG1GC not supported in java kernel vm.");
 772 #endif // INCLUDE_ALL_GCS
 773 
 774   } else {
 775     GenCollectorPolicy *gc_policy;
 776 
 777     if (UseSerialGC) {
 778       gc_policy = new MarkSweepPolicy();
 779     } else if (UseConcMarkSweepGC) {
 780 #if INCLUDE_ALL_GCS
 781       if (UseAdaptiveSizePolicy) {
 782         gc_policy = new ASConcurrentMarkSweepPolicy();
 783       } else {
 784         gc_policy = new ConcurrentMarkSweepPolicy();
 785       }
 786 #else  // INCLUDE_ALL_GCS
 787     fatal("UseConcMarkSweepGC not supported in this VM.");
 788 #endif // INCLUDE_ALL_GCS
 789     } else { // default old generation
 790       gc_policy = new MarkSweepPolicy();
 791     }

 792 
 793     Universe::_collectedHeap = new GenCollectedHeap(gc_policy);
 794   }
 795 
 796   jint status = Universe::heap()->initialize();
 797   if (status != JNI_OK) {
 798     return status;
 799   }
 800 
 801 #ifdef _LP64
 802   if (UseCompressedOops) {
 803     // Subtract a page because something can get allocated at heap base.
 804     // This also makes implicit null checking work, because the
 805     // memory+1 page below heap_base needs to cause a signal.
 806     // See needs_explicit_null_check.
 807     // Only set the heap base for compressed oops because it indicates
 808     // compressed oops for pstack code.
 809     bool verbose = PrintCompressedOopsMode || (PrintMiscellaneous && Verbose);
 810     if (verbose) {
 811       tty->cr();




 748     }
 749   }
 750 #endif
 751 
 752   assert(is_ptr_aligned((char*)base, alignment), "Must be");
 753   return (char*)base; // also return NULL (don't care) for 32-bit VM
 754 }
 755 
 756 jint Universe::initialize_heap() {
 757 
 758   if (UseParallelGC) {
 759 #if INCLUDE_ALL_GCS
 760     Universe::_collectedHeap = new ParallelScavengeHeap();
 761 #else  // INCLUDE_ALL_GCS
 762     fatal("UseParallelGC not supported in this VM.");
 763 #endif // INCLUDE_ALL_GCS
 764 
 765   } else if (UseG1GC) {
 766 #if INCLUDE_ALL_GCS
 767     G1CollectorPolicy* g1p = new G1CollectorPolicy();
 768     g1p->initialize_all();
 769     G1CollectedHeap* g1h = new G1CollectedHeap(g1p);
 770     Universe::_collectedHeap = g1h;
 771 #else  // INCLUDE_ALL_GCS
 772     fatal("UseG1GC not supported in java kernel vm.");
 773 #endif // INCLUDE_ALL_GCS
 774 
 775   } else {
 776     GenCollectorPolicy *gc_policy;
 777 
 778     if (UseSerialGC) {
 779       gc_policy = new MarkSweepPolicy();
 780     } else if (UseConcMarkSweepGC) {
 781 #if INCLUDE_ALL_GCS
 782       if (UseAdaptiveSizePolicy) {
 783         gc_policy = new ASConcurrentMarkSweepPolicy();
 784       } else {
 785         gc_policy = new ConcurrentMarkSweepPolicy();
 786       }
 787 #else  // INCLUDE_ALL_GCS
 788     fatal("UseConcMarkSweepGC not supported in this VM.");
 789 #endif // INCLUDE_ALL_GCS
 790     } else { // default old generation
 791       gc_policy = new MarkSweepPolicy();
 792     }
 793     gc_policy->initialize_all();
 794 
 795     Universe::_collectedHeap = new GenCollectedHeap(gc_policy);
 796   }
 797 
 798   jint status = Universe::heap()->initialize();
 799   if (status != JNI_OK) {
 800     return status;
 801   }
 802 
 803 #ifdef _LP64
 804   if (UseCompressedOops) {
 805     // Subtract a page because something can get allocated at heap base.
 806     // This also makes implicit null checking work, because the
 807     // memory+1 page below heap_base needs to cause a signal.
 808     // See needs_explicit_null_check.
 809     // Only set the heap base for compressed oops because it indicates
 810     // compressed oops for pstack code.
 811     bool verbose = PrintCompressedOopsMode || (PrintMiscellaneous && Verbose);
 812     if (verbose) {
 813       tty->cr();


src/share/vm/memory/universe.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File