Skip to content

Commit

Permalink
fix java_heap_size script
Browse files Browse the repository at this point in the history
 Changes to be committed:
	modified:   docker-compose.yml
	modified:   image-files/scripts/common.sh
	modified:   latest/Dockerfile.tws
	modified:   latest/scripts/common.sh
	modified:   latest/scripts/run.sh
	modified:   latest/tws-scripts/run_tws.sh
  • Loading branch information
gnzsnz committed Dec 4, 2023
1 parent f80786f commit 353df25
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
TIME_ZONE: ${TIME_ZONE:-Etc/UTC}
TZ: ${TIME_ZONE:-Etc/UTC}
CUSTOM_CONFIG: ${CUSTOM_CONFIG:-NO}
JAVA_HEAP_SIZE: ${JAVA_HEAP_SIZE:-}
SSH_TUNNEL: ${SSH_TUNNEL:-}
SSH_OPTIONS: ${SSH_OPTIONS:-}
SSH_ALIVE_INTERVAL: ${SSH_ALIVE_INTERVAL:-}
Expand Down
2 changes: 1 addition & 1 deletion image-files/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ set_ports() {
set_java_heap() {
if [ -n "${JAVA_HEAP_SIZE}" ]; then
_vmpath="${TWS_PATH}/ibgateway/${IB_GATEWAY_VERSION}"
_string="s/-Xmx768m/-Xmx${TWS_HEAP_SIZE}m/g"
_string="s/-Xmx768m/-Xmx${JAVA_HEAP_SIZE}m/g"
sed -i "${_string}" "${_vmpath}/ibgateway.vmoptions"
echo ".> Java heap size set to ${JAVA_HEAP_SIZE}m"
else
Expand Down
9 changes: 3 additions & 6 deletions latest/Dockerfile.tws
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ ARG DEBIAN_FRONTEND=noninteractive
RUN \
apt-get update -y && \
apt-get install --no-install-recommends --yes socat sshpass gettext-base \
libnspr4 libnss3 libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 \
libc6 libcairo2 libcrypto++8 libcups2 libdbus-1-3 libdrm2 libexpat1 \
libfontconfig1 libgbm1 libgcc-s1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 \
libpango-1.0-0 libpulse0 libx11-6 libxcb1 libxcomposite1 libxdamage1 \
libxext6 libxfixes3 libxkbcommon0 libxrandr2 libxshmfence1 libxtst6 \
xdg-utils && \
libnspr4 libnss3 libcrypto++8 xdg-utils xfce4-cpugraph-plugin \
xfce4-netload-plugin xfce4-taskmanager xfce4-xkb-plugin xfce4-notes \
gvfs gvfs-backends gvfs-fuse && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* # end

Expand Down
11 changes: 11 additions & 0 deletions latest/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,14 @@ set_ports() {
echo ".> SOCAT_PORT set to: ${SOCAT_PORT}"

}

set_java_heap() {
if [ -n "${JAVA_HEAP_SIZE}" ]; then
_vmpath="${TWS_PATH}/ibgateway/${IB_GATEWAY_VERSION}"
_string="s/-Xmx768m/-Xmx${JAVA_HEAP_SIZE}m/g"
sed -i "${_string}" "${_vmpath}/ibgateway.vmoptions"
echo ".> Java heap size set to ${JAVA_HEAP_SIZE}m"
else
echo ".> Usign default Java heap size 768m."
fi
}
3 changes: 3 additions & 0 deletions latest/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ apply_settings
# set API and socat ports
set_ports

# Java heap size
set_java_heap

# forward ports, socat or ssh
"${SCRIPT_PATH}/port_forwarding.sh" &

Expand Down
3 changes: 3 additions & 0 deletions latest/tws-scripts/run_tws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ set_ports
# apply settings
apply_settings

# Java heap size
set_java_heap

# forward ports, socat or ssh
"${SCRIPT_PATH}/port_forwarding.sh" &

Expand Down

1 comment on commit 353df25

@gnzsnz
Copy link
Owner Author

@gnzsnz gnzsnz commented on 353df25 Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix issue on java heap parameter, solves #51

Please sign in to comment.