Child pages
  • Memory Management

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

...

Table of Contents
styleupper-roman

Java Memory management introduction

...

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

...

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:

Code Block

java ... -Djava.awt.headless=true -Xmx1280m -Xms64m -XX:MaxPermSize=128m .....
Note
titleSpecifying -Xmx and -Xms values

When specifying the -Xmx and -Xms values, the following needs to be taken into account:

  • The value can only be an integer value
  • The value needs to be places directly behind the parameter, no spaces or equal signs
  • The value needs to be post fixed with the unit: "m" or "M" for megabytes, "g" or "G" for gigabytes
  • When changing the -Xms options,  make sure that the -Xmx option has a higher value
  • Both values need to be lower than the available memory on the machine

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:

Code Block

Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

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.

...

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

...