Skip to content

Commit

Permalink
Don't default to Eco JVM settings for unknown dynos (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
Malax authored Jan 5, 2024
1 parent 016db82 commit 70c3172
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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

0 comments on commit 70c3172

Please sign in to comment.