[ http://issues.apache.org/jira/browse/DERBY-1614?page=comments#action_12425214 ] John H. Embretsen commented on DERBY-1614: ------------------------------------------
Here is an illustration of how the NetServer class handles heap size settings when 'DERBY-1614_v1.diff' is applied: Input = the value of jvmflags when passed to NetServer Output = heap flags set when starting the Network Server via NetServer Old = 10.1.* and trunk SVN 420047 and earlier Current = current trunk, i.e. SVN 420048 and later New = current trunk if the above mentioned patch is applied Input: -ms11m -mx12m Old output: -ms11m -mx12m Current output: -ms11m -mx12m -ms16777216 -mx33554432 New output: -ms11m -mx12m Input: -Xms11m -Xmx12m Old output: -Xms11m -Xmx12m -ms16777216 -mx33554432 Current output: -Xms11m -Xmx12m -ms16777216 -mx33554432 New output: -Xms11m -Xmx12m Input: -ms11m Old output: -ms11m -mx33554432 Current output: -ms11m -ms16777216 -mx33554432 New output: -ms11m Input: -mx12m Old output: -mx12m -ms16777216 Current output: -mx12m -ms16777216 -mx33554432 New output: -mx12m Input: -Xms11m Old output: -Xms11m -ms16777216 -mx33554432 Current output: -Xms11m -ms16777216 -mx33554432 New output: -Xms11m Input: -Xmx12m Old output: -Xmx12m -ms16777216 -mx33554432 Current output: -Xmx12m -ms16777216 -mx33554432 New output: -Xmx12m Input: -ms11m -Xms12m -mx11m -Xmx12m Old output: -ms11m -Xms12m -mx11m -Xmx12m Current output: -ms11m -Xms12m -mx11m -Xmx12m New output: -ms11m -Xms12m -mx11m -Xmx12m Input: null or "" Old output: Current output: New output: > Test harness overrides heap size settings when starting Network Server > ---------------------------------------------------------------------- > > Key: DERBY-1614 > URL: http://issues.apache.org/jira/browse/DERBY-1614 > Project: Derby > Issue Type: Bug > Components: Test > Affects Versions: 10.2.0.0 > Environment: Test frameworks DerbyNet and DerbyNetClient > Reporter: John H. Embretsen > Assigned To: John H. Embretsen > Fix For: 10.2.0.0 > > Attachments: DERBY-1614_v1.diff > > > Test specific heap size settings can be passed to the test harness using the > jvmflags system property, for example in a <testname>_app.properties file or > at the command line when starting a test, e.g "-Djvmflags=-Xms32m^-Xmx32m". > The test harness almost always overrides such settings when starting a new > Network Server using the > org.apache.derbyTesting.functionTests.harness.NetServer class of the test > harness. Currently, if _either_ -ms _or_ -Xms is missing from the jvmflags, > NetServer.start() adds -ms16777216. Also, if _either_ -mx _or_ -Xmx is > missing from the jvmflags, NetServer.start() adds -ms33554432. This has been > the case since SVN revision 420048 (July 8, 2006). > Earlier revisions did not override the heap settings unless the newer -Xms or > -Xmx flags were used instead of the -ms and -mx flags. A patch for DERBY-1091 > attempted (among other things) to make the harness recognize the newer flags > as well as the older flags, but the resulting behavior is (most likely) not > as intended. > If a test is run in either the DerbyNet framework or the DerbyNetClient > framework, the test-specific JVM flags should (probably) be used for the > Network Server JVM as well as the test JVM. Currently, even if non-default > heap size flags are passed to the harness, the server JVM will ignore these > settings since the harness adds -ms and/or -mx flags _after_ all other heap > flags. The exception is if both new and old versions of heap flags are passed > to the harness, e.g: > jvmflags=-ms32m^-Xms32m^-mx128m^-Xmx128m > Here is the code causing this behaviour: > if (setJvmFlags && ((jvmflags.indexOf("-ms") == -1) || > (jvmflags.indexOf("-Xms") == -1))) > // only setMs if no starting memory was given > jvm.setMs(16*1024*1024); // -ms16m > if (setJvmFlags && ((jvmflags.indexOf("-mx") == -1) || > (jvmflags.indexOf("-Xmx") == -1))) > // only setMx if no max memory was given > jvm.setMx(32*1024*1024); // -mx32m -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
