Skip to content

Commit

Permalink
GEODE-10206: clean up product references to CMS (#7646)
Browse files Browse the repository at this point in the history
* the command line validator no longer warns if CMS is not configured if the JDK does not support CMS
* cleaned up comments that refer to CMS
  • Loading branch information
dschneider-pivotal authored May 6, 2022
1 parent 0ad4c8a commit 95180e4
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions extensions/geode-modules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies {
compileOnly('javax.servlet:javax.servlet-api')
compileOnly('org.apache.tomcat:catalina-ha:' + DependencyConstraints.get('tomcat6.version'))

implementation('org.apache.commons:commons-lang3')

// test
testImplementation('org.apache.bcel:bcel')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,8 @@ private void initializeResourceManager() {
}
}

// Validate java startup parameters (done after setting the eviction and
// critical heap percentages so that the CMSInitiatingOccupancyFraction can
// be compared against them.
// Validate java startup parameters after setting the eviction and
// critical heap percentages so that they can be compared against them.
ResourceManagerValidator.validateJavaStartupParameters(getCache());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
*/
package org.apache.geode.modules.util;

import static org.apache.commons.lang3.JavaVersion.JAVA_13;
import static org.apache.commons.lang3.SystemUtils.isJavaVersionAtMost;

import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.ArrayList;
Expand Down Expand Up @@ -106,15 +109,22 @@ private static void validateJavaHeapParameters(GemFireCache cache, String dashXm
}
}

private static boolean isCMSAvailable() {
return isJavaVersionAtMost(JAVA_13);
}

private static void verifyCMSGC(GemFireCache cache, String useCMS) {
if (useCMS == null) {
if (useCMS == null && isCMSAvailable()) {
cache.getLogger().warning(
"Using the concurrent garbage collector (configured using -XX:+UseConcMarkSweepGC) is recommended so that GemFire cache eviction is optimal");
}
}

private static void verifyCMSInitiatingOccupancyFraction(GemFireCache cache, ResourceManager rm,
String cmsIOF) {
if (!isCMSAvailable()) {
return;
}
if (cmsIOF == null) {
cache.getLogger().warning(
"Setting the CMS initiating occupancy fraction (configured using -XX:CMSInitiatingOccupancyFraction=N) is recommended so that GemFire cache eviction is optimal");
Expand Down
5 changes: 5 additions & 0 deletions extensions/geode-modules/src/test/resources/expected-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,10 @@
<artifactId>slf4j-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ public static EvictionAttributes createLRUEntryAttributes(int maximumEntries,
* switches to control the behavior of the garbage collector. We suggest that you investigate
* tuning the garbage collector when using this type of eviction controller. A collector that
* frequently collects is needed to keep our heap usage up to date. In particular, on the Sun
* <A href="http://java.sun.com/docs/hotspot/gc/index.html">HotSpot</a> JVM, the
* <code>-XX:+UseConcMarkSweepGC</code> flag needs to be set, and
* <A href="http://java.sun.com/docs/hotspot/gc/index.html">HotSpot</a> JVM,
* before Java 14,
* the <code>-XX:+UseConcMarkSweepGC</code> flag needs to be set, and
* <code>-XX:CMSInitiatingOccupancyFraction=N</code> should be set with N being a percentage that
* is less than the {@link ResourceManager} eviction heap threshold.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ public interface ResourceManager {
* additional VM switches to control the behavior of the garbage collector. We suggest that you
* investigate tuning the garbage collector when using this type of eviction controller. A
* collector that frequently collects is needed to keep our heap usage up to date. In particular,
* on the Sun <A href="http://java.sun.com/docs/hotspot/gc/index.html">HotSpot</a> VM, the
* <code>-XX:+UseConcMarkSweepGC</code> flag needs to be set, and
* on the Sun <A href="http://java.sun.com/docs/hotspot/gc/index.html">HotSpot</a> VM,
* before Java 14,
* the <code>-XX:+UseConcMarkSweepGC</code> flag needs to be set, and
* <code>-XX:CMSInitiatingOccupancyFraction=N</code> should be set with N being a percentage that
* is less than the {@link ResourceManager} critical and eviction heap thresholds.
*
Expand Down

0 comments on commit 95180e4

Please sign in to comment.