Container Resource Management
OL Terminal can run in Docker or Kubernetes containers. Configure container memory and heap sizing together so the JVM uses the container limit, recovers unused heap after load spikes, and leaves room for native memory and operating-system overhead.
Docker memory behavior
Set a container memory limit for production deployments. For example, use docker run -m 2g for Docker, or a Kubernetes memory limit in the pod spec or Helm values.
Size the Java heap from the container limit with JAVA_OPTS, for example:
JAVA_OPTS=-XX:MaxRAMPercentage=75
Without a container memory limit, the JVM may size its heap from the whole host instead of the container. That can make the heap too large for the container or node policy.
The Docker image starts Java with these memory defaults:
-XX:+UseG1GC -XX:G1PeriodicGCInterval=60000
These settings let the JVM run a periodic G1 cleanup after 60 seconds with no garbage collection, then return unused heap to the operating system. This helps container memory fall back after a traffic spike instead of staying near the peak.
If you set JAVA_OPTS, it can override the default JVM flags. When you replace the defaults, include equivalent garbage-collection settings if you still want idle heap to be returned to the operating system.
5250 session memory recovery
Closed or failed 5250 sessions are released when the session ends. OL Terminal does not keep the ended session registered for the life of the JVM, so screens and buffers from ended IBM i browser sessions can be garbage-collected after close or failed connection.
Helm resources
The Helm chart supports optional resources blocks for both deployments. They are empty by default, so add requests and limits that match your environment.
Example:
as400:
resources:
requests:
memory: 1Gi
limits:
memory: 2Gi
mainframe:
resources:
requests:
memory: 1Gi
limits:
memory: 2Gi
When you set memory limits in Helm, also size the JVM heap from the limit, for example by adding JAVA_OPTS=-XX:MaxRAMPercentage=75 to the deployment's environment secret.
Monitor memory
Container memory tools show the container's committed memory and operating-system view. For heap sizing decisions, also check JVM heap in use. After traffic drops, allow time for a periodic G1 cleanup before judging whether idle heap has returned to the operating system.
Deployment checklist
- Set a container memory limit for each OL Terminal deployment.
- Set
JAVA_OPTS=-XX:MaxRAMPercentage=75or another percentage approved for your workload. - Keep enough memory outside the Java heap for native memory, threads, buffers, and the operating system.
- Use Helm
resourcesfor both AS/400 and mainframe deployments when running in Kubernetes. - Confirm memory behavior after a representative traffic spike before production rollout.
Run OL Terminal containers with memory limits, heap sizing, idle heap recovery, and optional Helm resources.