--- a/src/hotspot/share/memory/metaspace.hpp Thu Oct 04 14:03:13 2018 +0200
+++ b/src/hotspot/share/memory/metaspace.hpp Thu Oct 04 16:39:07 2018 +0200
@@ -71,6 +71,7 @@
class PrintCLDMetaspaceInfoClosure;
class SpaceManager;
class VirtualSpaceList;
+ class VirtualSpaceNode;
}
// Metaspaces each have a SpaceManager and allocations
@@ -297,6 +298,10 @@
// Spacemanager updates running counters.
friend class metaspace::SpaceManager;
+ // Special access for error reporting (checks without locks).
+ friend class oopDesc;
+ friend class Klass;
+
// Running counters for statistics concerning in-use chunks.
// Note: capacity = used + free + waste + overhead. Note that we do not
// count free and waste. Their sum can be deduces from the three other values.
@@ -324,6 +329,12 @@
// Helper for print_xx_report.
static void print_vs(outputStream* out, size_t scale);
+ // Utils to check if a pointer or range is part of a committed metaspace region
+ // without acquiring any locks.
+ static metaspace::VirtualSpaceNode* find_enclosing_virtual_space(const void* p);
+ static bool is_in_committed(const void* p);
+ static bool is_range_in_committed(const void* from, const void* to);
+
public:
// Collect used metaspace statistics. This involves walking the CLDG. The resulting