|
Adjusting ElectroServer's Memory |
|
Before you read
Overview
In this tutorial you will learn how to use the ES Admin to configure ES5's memory limit or to set any other command line parameters for the JVM. Note: adding command line parameters to a batch file or shell script that runs ElectroServer is probably not going to work.
Memory Settings
ElectroServer is a Java application. All Java applications run inside of a "virtual machine". This virtual machine is very gracious of your computer and won't allow any application inside of it to take too much memory by default. ElectroServer can need more memory than the default 64 megabytes that's available as you start to get into higher-load environments. Because of this, you need to tell the virtual machine that it's OK for it to use more memory.
ES Admin has an easy way for you to specify the amount of memory that ES5 uses. From the Server Management Screen, select General Settings and look for the Memory Settings textfield. Enter the number of megabytes that you want to allocate to ES5. Be careful that you do not specify more MB than would be available on your server. Click Update to save your setting.

After restarting ES5, check the log to verify that the new memory setting is being used.
Command-line Parameters
If you also want to set the minimum memory allocated, this is done on the same screen. You can enter any valid Java command-line parameters in this textfield, again being very careful to only use valid parameters. Click Update to save the setting, then restart ES5 to apply it.

See also JMX.
Troubleshooting
If ElectroServer fails to start due to invalid memory settings or command-line parameters, ES Admin will not be able to connect to it. All is not lost however! Execute ElectroServer from the command line, using the -safemode parameter. This starts ES5 with the memory settings and command-line parameters from the database ignored, so that ES Admin can be used to modify them. See Running ElectroServer.