Skip to content

Commit

Permalink
optimize jvm parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
nlu90 committed Dec 5, 2023
1 parent 3e78407 commit f7e4377
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions controllers/spec/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,6 @@ func getProcessJavaRuntimeArgs(name, packageName, clusterName, logLevel, details
},
" ")
}
xmsMemory := resource.NewScaledQuantity(memory.Value()/2, 0)
args := []string{
"exec",
"java",
Expand All @@ -1124,9 +1123,12 @@ func getProcessJavaRuntimeArgs(name, packageName, clusterName, logLevel, details
"-Dpulsar.function.log.dir=logs/functions",
"-Dpulsar.function.log.file=" + fmt.Sprintf("%s-${%s}", name, EnvShardID),
setLogLevel,
"-Xmx" + getDecimalSIMemory(memory),
"-Xms" + getDecimalSIMemory(xmsMemory),
"-XX:InitialRAMPercentage=20",
"-XX:MaxRAMPercentage=40",
"-XX:+UseG1GC",
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:HeapDumpPath=/pulsar/tmp/heapdump-%p.hprof",
"-Xlog:gc*:file=/pulsar/logs/gc.log:time,level,tags:filecount=5,filesize=10M",
strings.Join(javaOpts, " "),
"org.apache.pulsar.functions.instance.JavaInstanceMain",
"--jar",
Expand Down

0 comments on commit f7e4377

Please sign in to comment.