RFR(S): 8072434: 8064457: introduces performance regressions in 9-b47

Coleen Phillimore coleen.phillimore at oracle.com
Wed Feb 4 23:13:54 UTC 2015


Hi Goetz,

I was trying to figure out how we used to decide whether to put the 
compressed class space above the heap in preferred_heap_base().  The 
code was:

     const size_t total_size = heap_size + 
heap_base_min_address_aligned;  // 30G + 2G

     ...
           // space so it can be decoded with no base.
           if (UseCompressedClassPointers && !UseSharedSpaces &&
               OopEncodingHeapMax <= 32*G) {

             uint64_t class_space = 
align_size_up(CompressedClassSpaceSize, alignment);   // 1G
assert(is_size_aligned((size_t)OopEncodingHeapMax-class_space,
                    alignment), "difference must be aligned too");
             uint64_t new_top = OopEncodingHeapMax-class_space;    // 
32G - 1G

             if (total_size <= new_top) {    // 32G <= 31G false, don't 
use the new_top.
               heap_top = new_top;
             }
           }

           // Align base to the adjusted top of the heap
           base = heap_top - heap_size;


This is also one instance where 32*G is much easier to understand in the 
code than the symbolic name OopEncodingHeapMax.

Anyway, your code fix looks correct.  You want it to be 
KlassEncodingMetaspaceMax logically (I thought it should be 
OopEncodingHeapMax) since allocating the class space above the heap and 
getting zero based compressed oops, the class decoding algorithm can 
only shift by 3 not 5.  The clause above it excludes the 
ObjAlignmentInBytes = shifting 5 case anyway.

Thank you for fixing this!

Coleen

On 2/4/15, 10:55 AM, Lindenmaier, Goetz wrote:
>
> Hi,
>
> There is a performance regression after my change 8064457.
>
> 30G heaps do not displace the CompressedClassSpace from the lower memory
>
> region and instead are allocated in upper regions.
>
> This webrev should fix the Problem.
>
> http://cr.openjdk.java.net/~goetz/webrevs/8072434-css/webrev.01/ 
> <http://cr.openjdk.java.net/%7Egoetz/webrevs/8072434-css/webrev.01/>
>
> I verified that it works now and ran runtime/CompressedOops jtreg 
> tests on linuxx86_64.
>
> I'll get a comprehensive test run by tomorrow.
>
> Best regards,
>
>   Goetz.
>



More information about the hotspot-dev mailing list