Scaling the Java heap
The Orchestrator server is a Java application, and everything a workflow holds while it runs, from a list of 5,000 VMs to a large JSON response, sits in its Java heap. When the heap fills up, the server stops answering, its pod restarts, and every running workflow is interrupted. This recipe shows how to recognise that, and how to give the server a bigger heap on a standalone appliance. On an Orchestrator embedded in VCF Automation, the log paths, the pods and what you can change are different: see On an embedded Orchestrator under There’s more.
Getting ready
- A standalone appliance or cluster and a root shell on each node: SSH in as
vmware-system-user, thensudo su -(recipe 2.1). - Permission to change the appliance VM’s memory in the vSphere Client.
- A snapshot of every node, taken as in recipe 2.6, and a maintenance window. Step 7 restarts all of Orchestrator’s services.
How to do it
- Confirm the heap is the problem. Look for out-of-memory errors in the server log, and for Orchestrator pods with a high restart count:
grep -c "java.lang.OutOfMemoryError" /services-logs/prelude/vco-app/console-logs/vco-server-app.logkubectl -n prelude get pods | grep vco-app/var/log/services-logs/prelude/vco-app/file-logs/vco-server-app.log, and there’s no console-logs folder.If the count is above zero, or the RESTARTS column for vco-app keeps climbing, carry on. If not, look elsewhere first: slow plug-in endpoints and long-running scripts look similar from the client.
-
Decide on the new size. Note the current settings and the VM’s memory, so you can work out how much to add. On 9.1 the server’s memory is set by three values:
Value Default What it does serverMemoryLimit4.4GThe most memory the Orchestrator server container may use serverMemoryRequest3.2GThe memory Kubernetes reserves for it serverJvmMaxRamPercentage40The share of the container’s limit that Java may use as heap The heap is the percentage of the limit, so the default heap is 40% of 4.4 GB, about 1.8 GB. In this recipe you raise the limit to
8Gand the percentage to50, for a 4 GB heap. -
Add memory to the VM first. Shut down the appliance from its console with
shutdown -h now, or with Power > Shut Down Guest OS in the vSphere Client. Add at least as much memory as you’re adding toserverMemoryLimit(here, 8 − 4.4 ≈ 4 GB, so 12 GB becomes 16 GB), then power the VM on and wait until all pods areRunning. -
Create a custom profile. A profile is a folder of settings that the appliance applies over its defaults every time it deploys its services. Create one with a
checkscript that always says “yes, apply me”:
mkdir -p /etc/vmware-prelude/profiles/custom-profile/helm/prelude_vcocat > /etc/vmware-prelude/profiles/custom-profile/check <<'EOF'#!/bin/bashexit 0EOFchmod 755 /etc/vmware-prelude/profiles/custom-profile/check- Write the new memory settings into the profile:
cat > /etc/vmware-prelude/profiles/custom-profile/helm/prelude_vco/90-resources.yaml <<'EOF'serverMemoryLimit: 8GserverMemoryRequest: 6GserverJvmMaxRamPercentage: 50EOFchmod 644 /etc/vmware-prelude/profiles/custom-profile/helm/prelude_vco/90-resources.yamlKeep serverMemoryRequest lower than serverMemoryLimit, and leave everything else in the file at its default.
- Check the file before you apply it. A typo here stops the services from starting:
cat /etc/vmware-prelude/profiles/custom-profile/helm/prelude_vco/90-resources.yaml- Apply it. Redeploy the services and wait for
Prelude has been deployed successfully:
/opt/scripts/deploy.sh- Check the new limits. The Orchestrator pod should now show the new memory limit, and the Java process the new percentage:
kubectl -n prelude describe pods -l app=vco-app | grep -A3 -i limitsps -eo args | grep -o -- '-XX:MaxRAMPercentage=[0-9.]*' | sort -uSSH session on vco01 showing the output of both commands from step 8: the Limits block of the vco-app pod with memory: 8G, and -XX:MaxRAMPercentage=50.
serverJvmMaxRamPercentage with the defaults shown in step 2. The 8.x procedure used serverJvmHeapMax instead. On 9.1.1, read the defaults from the KB’s setup script, confirm a file with only the three keys in step 5 is enough (the KB writes every default into it), and check that the commands in step 8 show the change. Correct the pod label in step 8 if app=vco-app doesn’t match.free -g on the appliance after step 7.How it works
The appliance doesn’t run Orchestrator directly. deploy.sh installs it into the appliance’s Kubernetes cluster from a Helm chart, and the chart’s values decide, among other things, how much memory each container may use and how big the Java heap inside it is.
Before it installs the chart, deploy.sh looks at every folder under /etc/vmware-prelude/profiles/. For each one it runs the check script. If the script exits with 0, the profile is active, and the files in its helm/prelude_vco/ folder are layered over the chart’s default values for Orchestrator. Your 90-resources.yaml only lists the values you want to change, so everything else keeps its default.
Kubernetes then enforces the numbers. serverMemoryRequest is reserved for the container when it starts. serverMemoryLimit is a hard ceiling: if the container goes over it, Kubernetes kills it. Java sizes its heap as a share of that ceiling, serverJvmMaxRamPercentage, and uses the rest for its own threads, code, and buffers. That’s why you can’t set the percentage close to 100: the container would be killed for going over its limit before Java ever reported that the heap was full.
deploy.sh selects and applies profiles is inferred from the KB’s script and file layout. Confirm it on 9.1.1, and check whether the custom profile survives an upgrade from 9.1.0 to 9.1.1.setenv.sh, change the -Xmx value, and restart the vco-server service./etc/vmware-prelude/profiles/ and run deploy.sh. Kubernetes enforces the container's memory, and Java sizes its heap from it.There's more
Clusters. Every node needs the same profile and the same VM memory. Add memory to each VM in turn, then create the profile on all three nodes. vracli cluster exec runs one command on every node, which is how Broadcom’s KB does it:
vracli cluster exec -- cat /etc/vmware-prelude/profiles/custom-profile/helm/prelude_vco/90-resources.yamlUse it to check that all three nodes have the same file before you run deploy.sh once, on any node.
More heap isn’t always the answer. If the heap fills up again after you’ve doubled it, something is holding on to memory. Typical causes are a workflow that loads a whole inventory into one array, an attribute that keeps growing on every loop, or thousands of finished runs kept with large outputs. Broadcom KB 372531 explains how to find the heap dump that the server writes when it runs out of memory, under /services-logs/prelude/vco-app/file-logs/, and how to analyse it.
Polyglot scripts have their own memory. Python, Node.js, and PowerShell actions run in separate containers, not in the Java heap. If those fail with memory errors, the values to raise are polyglotRunnerMemoryLimit and polyglotRunnerMemoryLimitVco, in the same file. Keep polyglotRunnerMemoryLimitVco 300 MB below polyglotRunnerMemoryLimit. Chapter 4 covers polyglot actions.
Undoing the change. Delete the custom-profile folder and run deploy.sh again to go back to the defaults. You can then shrink the VM, with it powered off.
On an embedded Orchestrator
Section titled “On an embedded Orchestrator ”auto.vmw.lab, unless a note says otherwise.Inside VCF Automation, Orchestrator is one pod, vco-app-0, in the prelude namespace, among about 70 VCF Automation pods on the same appliance. The pod list from step 1 of this recipe looks nothing like a standalone appliance’s, so look for vco-app-0 by name.
What it runs with. The server container’s memory limit in the lab was 4.4 GB (4,399,996,928 bytes), and its Java process ran with -XX:MaxRAMPercentage=40, so a heap of about 1.8 GB: the values step 2 gives as the 9.1 defaults. Java also ran with -XX:+HeapDumpOnOutOfMemoryError and -XX:+ExitOnOutOfMemoryError: when the heap fills, it writes a heap dump and stops, so the container restarts instead of hanging. You can read all of this without root:
ps -eo args | grep -- '-Dvco.app.hostname' | grep -v grep | grep -o -- '-XX:[A-Za-z]*RAMPercentage=[0-9.]*\|-XX:+[A-Za-z]*OutOfMemoryError'The logs. The server’s log files are in /var/log/services-logs/prelude/vco-app/file-logs/, and vmware-system-user can read them without sudo:
| File | What’s in it |
|---|---|
vco-server-app.log |
The server log. Search it for java.lang.OutOfMemoryError. |
vco-server-app_scripting.log |
The System.log() lines of every run, each tagged SCRIPTING_LOG with the action or workflow it came from. |
vco-server-app_gc.log, _gc.log.0 to .4 |
Java’s garbage collection: how full the heap gets and how long it pauses. |
vco-server-app_access.log |
One file per hour of the server’s HTTP requests. |
vco-server-app_catalina.log, _metrics.log |
The web server’s own log and the server’s metrics. |
Older files are rotated with a date and hour in the name, such as vco-server-app.log.2026120108.6. The same logs also appear as /var/log/vmsp-logs/file-logs/filelogs.prelude.vco-app.vco-server-app*.log. There’s no console-logs folder, and /var/log/containers has no vco-app files.
grep -c "java.lang.OutOfMemoryError" /var/log/services-logs/prelude/vco-app/file-logs/vco-server-app.logRestarts. As vmware-system-user, kubectl fails with The connection to the server localhost:8080 was refused: no Kubernetes configuration is loaded for that login, and the one that works, /etc/kubernetes/admin.conf, is readable only by root. Switch to root and point kubectl at it, as Broadcom KB 436828 describes:
sudo -iexport KUBECONFIG=/etc/kubernetes/admin.confThen see which of the pod’s two containers restarted, and how it last stopped:
kubectl -n prelude get pod vco-app-0 -o jsonpath='{range .status.containerStatuses[*]}{.name}{" restarts="}{.restartCount}{" last="}{.lastState.terminated.reason}{"/"}{.lastState.terminated.exitCode}{"\n"}{end}'In the lab:
vco-polyglot-runner restarts=0 last=/vco-server-app restarts=4 last=Error/143vco-server-app is the Orchestrator server; vco-polyglot-runner runs Python, Node.js and PowerShell scripts. The exit code tells you what kind of stop it was:
- 143 (
Error/143): the container was told to stop (SIGTERM) and did. Something outside the server stopped it, such as a failed health check, a restart or an upgrade. That’s what the lab showed, with noOutOfMemoryErrorin the log: not a heap problem. - 137 with the reason
OOMKilled: the container went over its 4.4 GB limit and Kubernetes killed it. The lab hadn’t had one (the container’s memory events showedoom_kill 0).
To see why a container was stopped, read the pod’s recent events and the last lines the stopped container wrote. Kubernetes keeps events for a short time only, so run these soon after the restart:
kubectl -n prelude get events --field-selector involvedObject.name=vco-app-0kubectl -n prelude logs vco-app-0 -c vco-server-app --previous | tail -100kubectl shows when the Java heap fills and ExitOnOutOfMemoryError stops the server, and where its heap dump lands on the appliance. Its heap dump path points inside the container, and the lab had no .hprof file under /var/log/services-logs/prelude/vco-app/ or /var/log/vmsp-logs/.What you can change. Nothing in steps 2 to 8: the VCF Automation appliance has no vracli, no /opt/scripts/deploy.sh and no /etc/vmware-prelude folder, so there’s no custom profile to write and nothing to apply it with. Fix what fills the heap (see More heap isn’t always the answer above), or move heavy workflows to a standalone Orchestrator and size that one.
See also
- 2.6 Backing up and restoring Orchestrator, for the snapshot before you start.
- 2.8 Setting system properties that matter, for limits on how many workflows run at once.
- Broadcom KB 447520: Increasing the external orchestrator heap memory in VMware Aria Automation 9.1.
- Broadcom KB 372531, on workflow 502 errors caused by an exhausted heap, and on finding the heap dump: knowledge.broadcom.com/external/article/372531.
- Broadcom TechDocs (Aria Automation Orchestrator 8.16): How to Scale the Heap Memory Size of the Automation Orchestrator Server.
