RFR (S): 8006088: Incompatible heap size flags accepted by VM

Thomas Schatzl thomas.schatzl at oracle.com
Wed Apr 17 07:23:47 UTC 2013


Hi,

  I had the same concerns about inconsistencies with -Xms and
-XX:InitialHeapSize, but -Xms is (apparently) defined to set both
minimum and initial heap size.
I already raised that issue in an earlier discussion.

If you have an official source that states that -Xms only sets minimum
or initial heap size, I will gladly change this. I could not find
anything; actually the documentation (java -X) for -Xms states only that it sets the initial heap size.

The observations below result from this definition.

On Mon, 2013-04-15 at 16:29 -0700, John Cuthbertson wrote:
> Hi Thomas,
> 
> Why do we treat:
> 
> java -Xms8M  -XX:InitialHeapSize=4M...
> 
> as an error while accepting:

Because -Xms sets minimum heap size to 8M, and if you then set initial
heap size to 4M there is a conflict in the general condition that
minimum <= initial <= max.

> 
> java -XX:InitialHeapSize=4M -Xms8M...
> 
> It looks inconsistent. In both cases the user has asked for an initial 
> heap size less than his requested minimum.

As mentioned, -Xms unfortunately seems to be defined to set both initial
and minimum heap size. So there is no conflict.

> 
> In collectorPolicy.cpp, can the code on lines 79-80 and 83-84 be 
> coalesced into a single line for each? This would make the setting of 
> Initial and Min consistent with the code that sets Max on line 87.
> 

Done.

See http://cr.openjdk.java.net/~tschatzl/8006088/webrev.7/ for the new
webrev.

In addition to this change I fixed the headers of the jprt test cases to
avoid some issues with jtreg. Namely precompile the used classes and
install the whitebox api class into the boot class path.

> > Bugs.sun.com:
> > http://bugs.sun.com/view_bug.do?bug_id=8006088
> >
> > JIRA:
> > https://jbs.oracle.com/bugs/browse/JDK-8006088
> >
> > Testing:
> > jprt, manual invocation of all test cases

Testing:
jprt, jtreg run of test cases

> Other than these nits - it looks good to me. Very exhaustive test case.
> 

Thanks,
  Thomas






More information about the hotspot-gc-dev mailing list