Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't default to Eco JVM settings for unknown dynos #282

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Main

* JVM runtime options for Dynos that are **not** `Eco`, `Basic`, `Standard-1X`, `Standard-2X`, `Performance-M` or `Performance-L` (or their Private Spaces equivalents) will no longer default to the options for `Eco` Dynos. Instead, JVM ergonomics will be used in conjunction with `-XX:MaxRAMPercentage=80.0` to ensure sensible defaults for such Dynos. ([#282](https://github.com/heroku/heroku-buildpack-jvm-common/pull/282))

## v148

* Upgrade default JDKs to 21.0.1, 17.0.9, 11.0.21 and 8u392. ([#280](https://github.com/heroku/heroku-buildpack-jvm-common/pull/280))
Expand Down
11 changes: 9 additions & 2 deletions opt/jvmcommon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ calculate_java_memory_opts() {

limit=$(ulimit -u)
case $limit in
256) # Eco, Basic, 1X: memory.limit_in_bytes=536870912
echo "$opts -Xmx300m -Xss512k -XX:CICompilerCount=2"
;;
512) # 2X, private-s: memory.limit_in_bytes=1073741824
echo "$opts -Xmx671m -XX:CICompilerCount=2"
;;
Expand All @@ -14,8 +17,12 @@ calculate_java_memory_opts() {
32768) # perf-l, private-l: memory.limit_in_bytes=15032385536
echo "$opts -Xmx12g"
;;
*) # Free, Hobby, 1X: memory.limit_in_bytes=536870912
echo "$opts -Xmx300m -Xss512k -XX:CICompilerCount=2"
*)
# Rely on JVM ergonomics for other dyno types, but increase the maximum RAM percentage from 25% to 80%.
# This is more consistent with the Heroku defaults for other dyno types. For example, a 32GB dyno would only use
# 8GB of heap with the 25% default, but performance-l with 14GB of memory would get 12GB max heap size as
# explicitly configured.
echo "$opts -XX:MaxRAMPercentage=80.0"
;;
esac
}
Expand Down