Question about VirtualSpace and MPSS support

Thomas Stüfe thomas.stuefe at
Wed Nov 9 15:00:20 UTC 2016

Hi all,

please help me understand some details about the VirtualSpace class.

Background: I am experimenting with putting humongous metaspace chunks at
the end of the VirtualSpace (part of So I would like to have
a VirtualSpace which allows me to allocate from both bottom and top.
Therefore I am checking how difficult it would be to extend the
VirtualSpace class to allow me to grow from both sides.

Now I try to understand the three-region-logic implemented to support
multiple page sizes:

VirtualSpace has three regions with three different granularities. I think
the intent is to support large pages for address ranges which are not
necessarily large page aligned, so this leaves small-paged regions at top
and/or bottom.

Looking at VirtualSpace::expand_by() I think the idea is that there is
always one continuous committed area spanning those three regions, right?
(instead of, say, each of the regions being committed independently). So,
just one high water mark, which is either in the low, middle or upper
region. If it is in the middle region, low region should be completely
committed, if it is in the upper region, low and middle regions should be
completely committed? I think it must be this way, because from the outside
I only should have one continuous committed address range, otherwise it
would be difficult to use this VirtualSpace.

But then, I have a function like VirtualSpace::actual_committed_size() - in
addition to VirtualSpace::committed_size() - which counts the committed
area for all three regions separately. Is there ever a case where comitted
size and actual comitted size are different? Can it be that lower regions
are partly comitted even if higher regions are already used?

Thank you!

Kind Regards, Thomas

More information about the hotspot-runtime-dev mailing list