# Increase the available memory for the server; adjust according to the capabilities of the server:
JAVA_OPTS="-Xmx8G -XX:MaxPermSize=128M"

# Run "headless" on servers without an X11 display:
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"

# Prefer to use IPv4:
JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"

# Increase the time (in hours) until read socket times out to allow longer jobs to execute.
# Java default is 2 hours.
SOCKET_READ_TIMEOUT=6
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.transport.tcp.readTimeout=$((${SOCKET_READ_TIMEOUT}*3600*1000))"

# Set up a proxy:
#JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=<proxy.host.name> -Dhttp.proxyPort=<###> "-Dhttp.nonProxyHosts=127.0.0.1|<local host ip>|<local hostname>"

# Redefine the local IP to overcome possible network misconfigurations, for example a wrong /etc/hosts file or misconfigured DHCP server:
#JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=<external IP address>"
