From what I have understood, the Native Area inside the JVM is completely off-limits for the Garbage Collector. Inside the Native Area, in which Metaspace is located. In the aforementioned Metaspace, we have areas such as Constant Pool, Field and Method Data.
Since the Native Area is managed by the C++ memory management (or at least that's how I understand it), how come that Metaspace, that is not of a fixed size, instead grows dynamically, depending on how much memory is needed, will not run out of the memory? Is Garbage Collector allowed in the Metaspace, but not the rest of Native Area? Is C++ managing the memory there dynamically?
how come that Metaspace, that is not of a fixed size
You can limit the size by setting value for MaxMetaSpaceSize
on command line.
...will not run out of the memory?
Yes, it actually does run out of memory. When it exceeds usage of available memory and will get java.lang.OutOfMemoryError: Metaspace
exception.
Is Garbage Collector allowed in the Metaspace
Yes. The GC will collect both the Java Heap and the Metaspace, but not the native heap. It is managed by whoever native code owns it.
Reference :
3.2 Understand the OutOfMemoryError Exception
About G1 Garbage Collector, Permanent Generation and Metaspace