Servoy is built using Java technology and as such the memory management for Servoy is basically Java Memory management. This chapter describes the basics of Java Memory management, which will be sufficient for all but the most extensive and complex deployment scenario's.
Stoc |
---|
...
The basics of Java Memory management is straight forward:
...
The two most important spaces of memory that a Java process uses are the Java Heap Space and the Java Perm Space.
The Heap Space is the main space used by Java while operating. As such this space will use the most memory. The settings related to the Java Heap Space are the following:
...
When the Maximum Heap Space size is too low for that is actually needed by the Java process, the following exception will be thrown: java.lang.OutOfMemoryError: Java heap space
The Perm Space is the space used by Java to store loaded classes and other static objects. The setting related to the Java Perm Space is only the following.
...
The above mentioned settings are settings that can be applied when launching a Java process command-line or form a .bat/.sh script. Certain application might provide other ways to specify the same settings, for example the Service component that is part of the Servoy distribution. For more information on how to configure these settings withing Servoy, read the next paragraph.
...
Memory management for a Servoy Application Server revolves around managing the values for the Java Heap Space and Java Perm Space.
...
{serverInstall}\application_server\service\wrapper.conf
{serverInstall}\application_server\servoy_server.bat/.sh
{serverInstall}\application_server\terracotta/start_servoy_clustered.bat/.sh
...
...
The components that contribute to the Java Heap Space requirements for a Servoy Application Server consists of the following parts:
...
...
...
The setting that requires tuning based on the determined required memory for the Servoy Application Server is the Maximum Heap Space setting (Xmx). By default the Maximum Heap Space is set to 1028MB within Servoy. This setting should be changed when:
...
Depending on how the Servoy Application Server is started, the Memory setting need to be applied in a different location.
...
When using the Service component to automatically launch the Servoy Application Server when the machine on which it is installed is booted, the memory settings for the Application Server can be configured inside {serverInstall}\application_server\service\wrapper.conf
by altering the "wrapper.java.maxmemory
" setting:
Code Block |
---|
wrapper.java.additional.4=-XX:MaxPermSize=128m # Initial Java Heap Size (in MB) wrapper.java.initmemory=32 # Maximum Java Heap Size (in MB) wrapper.java.maxmemory=1280 |
For more information on configuring the Service component, see Running The the Server As A a Service
...
When starting the Servoy Application Server manually, either through {serverInstall}\application_server\servoy_server.bat/.sh
or {serverInstall}\application_server\terracotta/start_servoy_clustered.bat/.sh
, the memory settings for the Application Server can be configured inside the .bat/.sh, by altering the -Xmx value:
...
Note | ||
---|---|---|
| ||
When specifying the -Xmx and -Xms values, the following needs to be taken into account:
In a default Servoy Application Server installation, the Maximum Heap Space value (-Xmx) is set to 1280m. For servers that have limited memory, this value could be too high, resulting in the following error when trying to start the server:
Either lower the -Xmx value or make sure that more memory is available for the Java process on the server, by closing other applications or adding more physical memory to the server. |
...
An 32 bit JVM will allow a maximum memory assignment of 2Gb in total. In order to assign more than 2Gb of memory, a 64 bit JVM on a 64 bit OS is required.
...
...
By default the Java Heap Space size is set to 128Mb, which is a sufficient value for most deployments. A scenario in which this value needs increasing is when the Servoy Application Server is loaded up with a lot of additional plugins, beans, LAF's and drivers.
...
For all three scenario's that the Servoy Application Server can be started (as a service, manual stand-alone or manual clustered), the value for the Java Perm Space is controlled by the "'XX:MaxPermSize" ' setting in the above mentioned configuration location.
...
...
The actual memory usage of a Servoy Application Server can be observed on the Servoy Admin page. The "'Servoy Server Status" ' overview on the "'Servoy Server Home" ' page displays the allocated, used and maximum values for the Heap memory and all other spaces combined (non-Heap memory).
...
Similar to the Servoy Application Server, the Servoy Smart Client is also a Java application and as such the same memory management also applies to the Smart Client.
...
Setting | What is does | Comment |
---|---|---|
servoy.initialClientHeap | Sets the Initial Heap Space size |
|
servoy.maxClientHeap | Sets the Maximum Heap Space size |
|
servoy.vmClientArgs | optional arguments that can be send to the Smart Client's JVM | Set to "'-XX:SoftRefLRUPolicyMSPerMB=3600000" ' by default: this setting improves performance |
Within the Servoy Smart Client, the actual memory usage can be monitored through the Help > About menu item.