Configuring JVM memory settings in the microservice installation scripts
The easiest way to allocate less or more memory than the default for your standalone microservice is by editing the contents of the startup scripts, installService.ps1, start.ps1 or start.sh.
About this task
By default, the various microservices apply the following JVM memory settings:
| Service name | Initial and minimum heap size (-Xms setting) in MB | Maximum heap size (-Xmx setting) in MB |
|---|---|---|
| Cache Channel Service | 256 | 512 |
| Content Service | 512 | 1536 |
| Context Engine Service | 256 | 512 |
| Contextual Image Delivery | 256 | 512 |
| Deployer | 256 | 512 |
| Combined Deployer | 512 | 1024 |
| Deployer Worker | 512 | 1024 |
| Discovery Service | 128 | 256 |
| Monitoring Agent | 256 | 512 |
| Preview Service | 256 | 384 |
| Session-enabled Content Service | 512 | 1536 |
| UGC Community Service | 256 | 512 |
| UGC Moderation Service | 256 | 512 |
Depending on the specific microservice and on how you use it, these amounts may be too little or too much for your liking. If you want to change these values, edit the script you use.
Procedure
- If you already have your microservice installed and if you used installService.ps1 to install it, access the installation media and run the uninstallation script, uninstallService.ps1. If you started the microservice using start.ps1 or start.sh instead, simply close the window or kill the process that runs the microservice.
- Copy the installation script you intend to use, either start.ps1, start.sh or installService.ps1, from the installation media to a local directory.
- Open the script for editing.
- Find the line that starts with
$jvmoptions =followed by a comma-separated list of JVM options. - Change the values of the
-Xmsand/or-Xmxoptions. - Save and close your script.
- Follow the normal installation procedure for the standalone microservice script to install this standalone microservice.