Skip to content

Commit

Permalink
Enable containerV2 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritham Marupaka committed Jan 8, 2024
1 parent b0604ae commit af0cb89
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ configType: java
configVersion: 1
jvmOpts:
- '-XX:InitialRAMPercentage=70.0'
experimental:
containerV2: true
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ configType: java
configVersion: 1
jvmOpts:
- '-XX:MaxRAMPercentage=70.0'
experimental:
containerV2: true

Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ configVersion: 1
jvmOpts:
- '-Xms1g'
- '-Xmx1g'
experimental:
containerV2: true
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
configType: java
configVersion: 1
jvmOpts: []
experimental:
containerV2: true
8 changes: 4 additions & 4 deletions launchlib/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,10 @@ func delim(str string) string {
func createJvmOpts(combinedJvmOpts []string, customConfig *CustomLauncherConfig, logger io.WriteCloser) []string {
if isEnvVarSet("CONTAINER") && !customConfig.DisableContainerSupport && !hasMaxRAMOverride(combinedJvmOpts) {
_, _ = fmt.Fprintln(logger, "Container support enabled")
if customConfig.Experimental.ContainerV2 {
if !customConfig.Experimental.ContainerV2 {
combinedJvmOpts = filterHeapSizeArgs(combinedJvmOpts)
combinedJvmOpts = ensureActiveProcessorCount(combinedJvmOpts, logger)
} else {
jvmOptsWithUpdatedHeapSizeArgs, err := filterHeapSizeArgsV2(combinedJvmOpts)
if err != nil {
// When we fail to get the memory limit from the cgroups files, fallback to using percentage-based heap
Expand All @@ -294,9 +297,6 @@ func createJvmOpts(combinedJvmOpts []string, customConfig *CustomLauncherConfig,
} else {
combinedJvmOpts = jvmOptsWithUpdatedHeapSizeArgs
}
} else {
combinedJvmOpts = filterHeapSizeArgs(combinedJvmOpts)
combinedJvmOpts = ensureActiveProcessorCount(combinedJvmOpts, logger)
}
return combinedJvmOpts
}
Expand Down

0 comments on commit af0cb89

Please sign in to comment.