< prev index next >

src/hotspot/share/classfile/classLoaderDataGraph.hpp

Print this page




  43   // All CLDs (except the null CLD) can be reached by walking _head->_next->...
  44   static ClassLoaderData* _head;
  45   static ClassLoaderData* _unloading;
  46   // CMS support.
  47   static ClassLoaderData* _saved_head;
  48   static ClassLoaderData* _saved_unloading;
  49   static bool _should_purge;
  50 
  51   // Set if there's anything to purge in the deallocate lists or previous versions
  52   // during a safepoint after class unloading in a full GC.
  53   static bool _should_clean_deallocate_lists;
  54   static bool _safepoint_cleanup_needed;
  55 
  56   // OOM has been seen in metaspace allocation. Used to prevent some
  57   // allocations until class unloading
  58   static bool _metaspace_oom;
  59 
  60   static volatile size_t  _num_instance_classes;
  61   static volatile size_t  _num_array_classes;
  62 
  63   static ClassLoaderData* add_to_graph(Handle class_loader, bool is_unsafe_anonymous);
  64   static ClassLoaderData* add(Handle class_loader, bool is_unsafe_anonymous);
  65 
  66  public:
  67   static ClassLoaderData* find_or_create(Handle class_loader);
  68   static void clean_module_and_package_info();
  69   static void purge();
  70   static void clear_claimed_marks();
  71   // Iteration through CLDG inside a safepoint; GC support
  72   static void cld_do(CLDClosure* cl);
  73   static void cld_unloading_do(CLDClosure* cl);
  74   static void roots_cld_do(CLDClosure* strong, CLDClosure* weak);
  75   static void always_strong_cld_do(CLDClosure* cl);
  76   // Iteration through CLDG not by GC.
  77   static void loaded_cld_do(CLDClosure* cl);
  78   // klass do
  79   // Walking classes through the ClassLoaderDataGraph include array classes.  It also includes
  80   // classes that are allocated but not loaded, classes that have errors, and scratch classes
  81   // for redefinition.  These classes are removed during the next class unloading.
  82   // Walking the ClassLoaderDataGraph also includes unsafe anonymous classes.
  83   static void classes_do(KlassClosure* klass_closure);
  84   static void classes_do(void f(Klass* const));
  85   static void methods_do(void f(Method*));
  86   static void modules_do(void f(ModuleEntry*));
  87   static void modules_unloading_do(void f(ModuleEntry*));
  88   static void packages_do(void f(PackageEntry*));
  89   static void packages_unloading_do(void f(PackageEntry*));
  90   static void loaded_classes_do(KlassClosure* klass_closure);
  91   static void unlocked_loaded_classes_do(KlassClosure* klass_closure);
  92   static void classes_unloading_do(void f(Klass* const));
  93   static bool do_unloading();
  94 
  95   // Expose state to avoid logging overhead in safepoint cleanup tasks.
  96   static inline bool should_clean_metaspaces_and_reset();
  97   static void set_should_clean_deallocate_lists() { _should_clean_deallocate_lists = true; }
  98   static void clean_deallocate_lists(bool purge_previous_versions);
  99   static void walk_metadata_and_clean_metaspaces();
 100 
 101   // dictionary do
 102   // Iterate over all klasses in dictionary, but




  43   // All CLDs (except the null CLD) can be reached by walking _head->_next->...
  44   static ClassLoaderData* _head;
  45   static ClassLoaderData* _unloading;
  46   // CMS support.
  47   static ClassLoaderData* _saved_head;
  48   static ClassLoaderData* _saved_unloading;
  49   static bool _should_purge;
  50 
  51   // Set if there's anything to purge in the deallocate lists or previous versions
  52   // during a safepoint after class unloading in a full GC.
  53   static bool _should_clean_deallocate_lists;
  54   static bool _safepoint_cleanup_needed;
  55 
  56   // OOM has been seen in metaspace allocation. Used to prevent some
  57   // allocations until class unloading
  58   static bool _metaspace_oom;
  59 
  60   static volatile size_t  _num_instance_classes;
  61   static volatile size_t  _num_array_classes;
  62 
  63   static ClassLoaderData* add_to_graph(Handle class_loader, bool is_shortlived);
  64   static ClassLoaderData* add(Handle class_loader, bool is_shortlived);
  65 
  66  public:
  67   static ClassLoaderData* find_or_create(Handle class_loader);
  68   static void clean_module_and_package_info();
  69   static void purge();
  70   static void clear_claimed_marks();
  71   // Iteration through CLDG inside a safepoint; GC support
  72   static void cld_do(CLDClosure* cl);
  73   static void cld_unloading_do(CLDClosure* cl);
  74   static void roots_cld_do(CLDClosure* strong, CLDClosure* weak);
  75   static void always_strong_cld_do(CLDClosure* cl);
  76   // Iteration through CLDG not by GC.
  77   static void loaded_cld_do(CLDClosure* cl);
  78   // klass do
  79   // Walking classes through the ClassLoaderDataGraph include array classes.  It also includes
  80   // classes that are allocated but not loaded, classes that have errors, and scratch classes
  81   // for redefinition.  These classes are removed during the next class unloading.
  82   // Walking the ClassLoaderDataGraph also includes nonfindable and unsafe anonymous classes.
  83   static void classes_do(KlassClosure* klass_closure);
  84   static void classes_do(void f(Klass* const));
  85   static void methods_do(void f(Method*));
  86   static void modules_do(void f(ModuleEntry*));
  87   static void modules_unloading_do(void f(ModuleEntry*));
  88   static void packages_do(void f(PackageEntry*));
  89   static void packages_unloading_do(void f(PackageEntry*));
  90   static void loaded_classes_do(KlassClosure* klass_closure);
  91   static void unlocked_loaded_classes_do(KlassClosure* klass_closure);
  92   static void classes_unloading_do(void f(Klass* const));
  93   static bool do_unloading();
  94 
  95   // Expose state to avoid logging overhead in safepoint cleanup tasks.
  96   static inline bool should_clean_metaspaces_and_reset();
  97   static void set_should_clean_deallocate_lists() { _should_clean_deallocate_lists = true; }
  98   static void clean_deallocate_lists(bool purge_previous_versions);
  99   static void walk_metadata_and_clean_metaspaces();
 100 
 101   // dictionary do
 102   // Iterate over all klasses in dictionary, but


< prev index next >