United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7125281 : G1: heap expansion code is replicated

Details
Type:
Bug
Submit Date:
2011-12-27
Status:
Closed
Updated Date:
2012-03-29
Project Name:
JDK
Resolved Date:
2012-03-29
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs23
Fixed Versions:
hs23 (b10)

Related Reports
Backport:
Backport:

Sub Tasks

Description
Recently, we accidentally replicated the code that does heap expansion at the end of a GC:

        init_mutator_alloc_region();

        {
          size_t expand_bytes = g1_policy()->expansion_amount();
          if (expand_bytes > 0) {
            size_t bytes_before = capacity();
            if (!expand(expand_bytes)) {
              // We failed to expand the heap so let's verify that
              // committed/uncommitted amount match the backing store
              assert(capacity() == _g1_storage.committed_size(), "committed size mismatch");
              assert(max_capacity() == _g1_storage.reserved_size(), "reserved size mismatch");
            }
          }
        }

  ...

      {
        size_t expand_bytes = g1_policy()->expansion_amount();
        if (expand_bytes > 0) {
          size_t bytes_before = capacity();
          // No need for an ergo verbose message here,
          // expansion_amount() does this when it returns a value > 0.
          if (!expand(expand_bytes)) {
            // We failed to expand the heap so let's verify that
            // committed/uncommitted amount match the backing store
            assert(capacity() == _g1_storage.committed_size(), "committed size mismatch");
            assert(max_capacity() == _g1_storage.reserved_size(), "reserved size mismatch");
          }
        }
      }

This looks to have happened due to a mis-merge. I _think_ it's the second copy that should be deleted (after the comment from it is also applied to the first copy).
The original intention was to move the heap expansion code "up" so it is indeed the second copy that should be deleted.

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/97c00e21fecb
                                     
2012-03-22
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/97c00e21fecb
                                     
2012-01-18
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/97c00e21fecb
                                     
2012-01-10



Hardware and Software, Engineered to Work Together