How to Configure JVM Options and Environment Variables in Plesk
When running memory-intensive or specialized Java applications on a Systron Plesk server, you may need to adjust the Java Virtual Machine (JVM) memory allocations or pass specific environment properties to your application lifecycle.
Step 1: Set Custom JVM Memory Limits (-Xmx / -Xms)
By default, the server allocates standard memory limits. If your application throws an OutOfMemoryError, you can adjust these allocations:
- Log in to your Plesk control panel dashboard.
- Navigate to Websites & Domains and open the Java or Application Server management area.
- Look for the JVM Settings or Java Options configuration box.
- Add your desired arguments separated by a space. For example, to set the initial memory to 256MB and maximum memory to 1GB, enter:
-Xms256m -Xmx1024m
Step 2: Add Custom System Properties
If your application framework relies on system variables (such as setting the active profile or a specific file path layout), you can append them right after the memory arguments using the -D flag:
- To define an environment variable in the runtime configuration box, use the following layout format:
-Dspring.profiles.active=production -Dconfig.file=/httpdocs/config.properties - Click OK or Apply at the bottom of the page to save your configurations.
Step 3: Apply the Changes
- Click the Restart Application button on your dashboard. Plesk will safely shut down the existing process worker thread and start a fresh JVM instance using your custom arguments.