Juan José Ramos Cassella created GEODE-4275:
-----------------------------------------------

             Summary: Duplicate CMSInitiatingOccupancyFraction Startup Parameter
                 Key: GEODE-4275
                 URL: https://issues.apache.org/jira/browse/GEODE-4275
             Project: Geode
          Issue Type: Bug
          Components: gfsh
            Reporter: Juan José Ramos Cassella


If you start a server/locator by specifying both {{max-heap}} and 
{{-XX:CMSInitiatingOccupancyFraction}}, logs show that a default 
{{CMSInitiatingOccupancyFraction`}} is also added in addition to the user 
specified value.

As an example, the command {{start server --name=server1 --max-heap=1g 
--J=-XX:CMSInitiatingOccupancyFraction=50 --server-port=0}} produces the 
following output:

{noformat}
  Command Line Parameters:
    -Dgemfire.start-dev-rest-api=false
    -Dgemfire.use-cluster-configuration=true
    -XX:CMSInitiatingOccupancyFraction=50
    -XX:OnOutOfMemoryError=kill -KILL %p
    -Xmx1g
    -XX:+UseConcMarkSweepGC
    -XX:CMSInitiatingOccupancyFraction=60
    -Dgemfire.launcher.registerSignalHandlers=true
    -Djava.awt.headless=true
    -Dsun.rmi.dgc.server.gcInterval=9223372036854775806
{noformat}

There are 2 entries for {{XX:CMSInitiatingOccupancyFraction}}.
The problem resides within the {{addMaxHeap}} method of the 
{{StartMemberUtils}} class:

{code:title=StartMemberUtils.java|borderStyle=solid}
  static void addMaxHeap(final List<String> commandLine, final String maxHeap) {
    if (StringUtils.isNotBlank(maxHeap)) {
      commandLine.add("-Xmx" + maxHeap);
      commandLine.add("-XX:+UseConcMarkSweepGC");
      commandLine.add("-XX:CMSInitiatingOccupancyFraction=" + 
CMS_INITIAL_OCCUPANCY_FRACTION);
    }
  }
{code}

The method is called by both the {{StartLocatorCommand}} and 
{{StartServerCommand}} after the jvmArgs have been already added to the parsed 
{{commandLine}}. The solution would be to simply check the collection before 
adding the {{-XX:CMSInitiatingOccupancyFraction}} option.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to