Closed electic closed 2 years ago
Java VM is configured on the ibgateway.vmoptions file. The current dockerfile does not allow to customize this (only jts.config and ibc config), but you can easily add. How to:
root@4ba59e45d0b2:~/Jts/ibgateway/1012.2c# ls
'IB Gateway 10.12.desktop' data ibgateway ibgateway.vmoptions jars uninstall
root@4ba59e45d0b2:~/Jts/ibgateway/1012.2c# cat ibgateway.vmoptions
#
# This file contains VM parameters for IB Gateway 10.12.
# Each parameter should be defined in a separate line and the
# last line must be followed by a line feed. No leading or
# trailing whitespaces are allowed in the same line, where a
# parameter is defined.
#
# Lines starting with a '#' character are treated as comments
# and ignored. Additionally, if a line contains a
# '### keep on update' string, all parameters defined below will
# be preserved on update.
#
-Xmx768m
-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70
-Dinstaller.uuid=dc71edfa-a1bb-4c1e-a0d9-9bac192054cd -DvmOptionsPath=/root/Jts/ibgateway/1012.2c/ibgateway.vmoptions -Dsun.awt.nopixfmt=true -Dsun.java2d.noddraw=true -Dswing.boldMetal=false -Dsun.locale.formatasdefault=true
- Save the file to ./config/ibgateway/ibgateway.vmoptions and set -Xmx768m to what you need
- Open ./Dockerfile (https://github.com/waytrade/ib-gateway-docker/blob/master/Dockerfile) and search for "COPY ./config/ibgateway/jts.ini /root/Jts/jts.ini" (line 33). That is where jts.ini file coped. After that line, add:
```COPY ./config/ibgateway/ibgateway.vmoptions /root/Jts/ibgateway/${IB_GATEWAY_VERSION}/ibgateway.vmoptions``` to also copy your ibgateway.vmoptions
- Re-build the image
IB Gateway will now use the ibgateway.vmoptions overwritten by the COPY, instead of the original installed by ./ibgateway-${IB_GATEWAY_VERSION}-standalone-linux-x64.sh
Great minds think alike. I went through the code to figure this out as well. I am happy to do a pull request if it helps. Let me know.
PRs always welcome ;)
PR merged to master
Thank you for putting this together. One question is how do you change the Java VM options? Right now it has it set to 768MB but what if we want to change that?