Skip to content
This repository was archived by the owner on Jan 7, 2024. It is now read-only.

Commit 7f3163e

Browse files
committed
Allow for changing Java initial mem via new optional environment variable.
For small environments it is helpful to be able run the controller with less memory (set by MEM_STARTUP). Memory usage will grow as needed until MEM_LIMIT.
1 parent a5359c3 commit 7f3163e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

readme-vars.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ available_architectures:
1818
opt_param_usage_include_env: true
1919
opt_param_env_vars:
2020
- { env_var: "MEM_LIMIT", env_value: "1024M", desc: "Optionally change the Java memory limit (-Xmx) (default is 1024M)." }
21+
- { env_var: "MEM_STARTUP", env_value: "512M", desc: "Optionally change the Java initial memory (-Xms) (default is 512M)." }
2122

2223
# Optional Block
2324
optional_block_1: true
@@ -78,6 +79,7 @@ app_setup_block: |
7879
7980
# changelog
8081
changelogs:
82+
- { date: "04.03.21:", desc: "Allow for changing Java initial mem via new optional environment variable."}
8183
- { date: "12.01.21:", desc: "Deprecate the `LTS` tag as Unifi no longer releases LTS stable builds. Existing users can switch to the `latest` tag. Direct upgrade from 5.6.42 (LTS) to 6.0.42 (latest) tested successfully."}
8284
- { date: "17.07.20:", desc: "Rebase 64 bit containers to Bionic and Mongo 3.6."}
8385
- { date: "16.06.20:", desc: "Add logrotate."}

root/etc/services.d/unifi/run

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@ if [ -z ${MEM_LIMIT+x} ]; then
66
MEM_LIMIT="1024M"
77
fi
88

9+
if [ -z ${MEM_STARTUP+x} ]; then
10+
MEM_STARTUP="512M"
11+
fi
12+
913
exec \
10-
s6-setuidgid abc java -Xmx"${MEM_LIMIT}" -jar /usr/lib/unifi/lib/ace.jar start
14+
s6-setuidgid abc java -Xms"${MEM_STARTUP}" -Xmx"${MEM_LIMIT}" -jar /usr/lib/unifi/lib/ace.jar start

0 commit comments

Comments
 (0)