From f7e4377de5b04a75e76e8b53fbfc36eeb3e24b37 Mon Sep 17 00:00:00 2001 From: Neng Lu Date: Tue, 5 Dec 2023 09:36:17 -0800 Subject: [PATCH] optimize jvm parameters --- controllers/spec/common.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/spec/common.go b/controllers/spec/common.go index dda1fa02..18874702 100644 --- a/controllers/spec/common.go +++ b/controllers/spec/common.go @@ -1113,7 +1113,6 @@ func getProcessJavaRuntimeArgs(name, packageName, clusterName, logLevel, details }, " ") } - xmsMemory := resource.NewScaledQuantity(memory.Value()/2, 0) args := []string{ "exec", "java", @@ -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",