src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
branchstuefe-new-metaspace-branch
changeset 58063 bdf136b8ae0e
parent 58059 baa4dd528de0
child 58199 595fcbebaa77
equal deleted inserted replaced
58062:65cad575ace3 58063:bdf136b8ae0e
    67 #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
    67 #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
    68 #if INCLUDE_JFR
    68 #if INCLUDE_JFR
    69 #include "gc/shenandoah/shenandoahJfrSupport.hpp"
    69 #include "gc/shenandoah/shenandoahJfrSupport.hpp"
    70 #endif
    70 #endif
    71 
    71 
    72 #include "memory/metaspace.hpp"
    72 
       
    73 #include "memory/metaspace/classLoaderMetaspace.hpp"
       
    74 #include "memory/metaspace/metaspaceEnums.hpp"
    73 #include "oops/compressedOops.inline.hpp"
    75 #include "oops/compressedOops.inline.hpp"
    74 #include "runtime/globals.hpp"
    76 #include "runtime/globals.hpp"
    75 #include "runtime/interfaceSupport.inline.hpp"
    77 #include "runtime/interfaceSupport.inline.hpp"
    76 #include "runtime/safepointMechanism.hpp"
    78 #include "runtime/safepointMechanism.hpp"
    77 #include "runtime/vmThread.hpp"
    79 #include "runtime/vmThread.hpp"
   874   return allocate_memory(req);
   876   return allocate_memory(req);
   875 }
   877 }
   876 
   878 
   877 MetaWord* ShenandoahHeap::satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,
   879 MetaWord* ShenandoahHeap::satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,
   878                                                              size_t size,
   880                                                              size_t size,
   879                                                              Metaspace::MetadataType mdtype) {
   881                                                              metaspace::MetadataType mdtype) {
   880   MetaWord* result;
   882   MetaWord* result;
   881 
   883 
   882   // Inform metaspace OOM to GC heuristics if class unloading is possible.
   884   // Inform metaspace OOM to GC heuristics if class unloading is possible.
   883   if (heuristics()->can_unload_classes()) {
   885   if (heuristics()->can_unload_classes()) {
   884     ShenandoahHeuristics* h = heuristics();
   886     ShenandoahHeuristics* h = heuristics();
  1992                             ShenandoahPhaseTimings::purge_cldg);
  1994                             ShenandoahPhaseTimings::purge_cldg);
  1993     ClassLoaderDataGraph::purge();
  1995     ClassLoaderDataGraph::purge();
  1994   }
  1996   }
  1995   // Resize and verify metaspace
  1997   // Resize and verify metaspace
  1996   MetaspaceGC::compute_new_size();
  1998   MetaspaceGC::compute_new_size();
  1997   MetaspaceUtils::verify_metrics();
       
  1998 }
  1999 }
  1999 
  2000 
  2000 // Process leftover weak oops: update them, if needed or assert they do not
  2001 // Process leftover weak oops: update them, if needed or assert they do not
  2001 // need updating otherwise.
  2002 // need updating otherwise.
  2002 // Weak processor API requires us to visit the oops, even if we are not doing
  2003 // Weak processor API requires us to visit the oops, even if we are not doing