mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-19 18:05:41 -05:00
feat(build): configure heap size to max 50% of available memory (#7800)
* feat(build): configure heap size to max 50% of available memory * Apply suggestions from code review Co-authored-by: brian-mulier-p <bmmulier@hotmail.fr> --------- Co-authored-by: brian-mulier-p <bmmulier@hotmail.fr>
This commit is contained in:
@@ -76,7 +76,11 @@ REM Opens java.util due to https://github.com/Azure/azure-sdk-for-java/issues/27
|
||||
REM Opens java.lang due to https://github.com/kestra-io/kestra/issues/1755, see https://github.com/micronaut-projects/micronaut-core/issues/9573
|
||||
SET "JAVA_ADD_OPENS=--add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED"
|
||||
|
||||
java %JAVA_OPTS% %JAVA_ADD_OPENS% -Djava.security.manager=allow -jar "%this%" %*
|
||||
REM Java options that Kestra engineers think are best for Kestra, they should be added before JAVA_OPTS so they are overridable:
|
||||
REM -XX:MaxRAMPercentage=50.0: configure max heap to 50% of available RAM (default 25%)
|
||||
SET "KESTRA_JAVA_OPTS=-XX:MaxRAMPercentage=50.0"
|
||||
|
||||
java %KESTRA_JAVA_OPTS %JAVA_OPTS% %JAVA_ADD_OPENS% -Djava.security.manager=allow -jar "%this%" %*
|
||||
|
||||
ENDLOCAL
|
||||
|
||||
|
||||
@@ -30,6 +30,10 @@ if [ "${LD_PRELOAD_ENABLED:-true}" = "true" ] && [ -z "$LD_PRELOAD" ] && [ -f "$
|
||||
export LD_PRELOAD="$LIBSTDC"
|
||||
fi
|
||||
|
||||
# Java options that Kestra engineers think are best for Kestra, they should be added before JAVA_OPTS so they are overridable:
|
||||
# -XX:MaxRAMPercentage=50.0: configure max heap to 50% of available RAM (default 25%)
|
||||
KESTRA_JAVA_OPTS="-XX:MaxRAMPercentage=50.0"
|
||||
|
||||
# Exec
|
||||
exec java ${JAVA_OPTS} ${JAVA_ADD_OPENS} -Djava.security.manager=allow -jar "$0" "$@"
|
||||
exec java ${KESTRA_JAVA_OPTS} ${JAVA_OPTS} ${JAVA_ADD_OPENS} -Djava.security.manager=allow -jar "$0" "$@"
|
||||
exit 127
|
||||
Reference in New Issue
Block a user