Child pages
  • Memory Management

Versions Compared

Key

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

...

  • Java Heap Space: 1280Mb
  • Java Perm Space: 128Mb (java7)
  •  Java Java meta space: 200Mb (java8+)

...

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.5=-XX:MetaspaceSize=200M
wrapper.java.additional.6=-XX:MaxMetaspaceSize=200M
wrapper.java.additional.7=-XX:MinMetaspaceFreeRatio=0
wrapper.java.additional.8=-XX:MaxMetaspaceFreeRatio=100 
wrapper.java.additional.49=-XX:MaxPermSize=128m
wrapper.java.additional.10=-XX:+UseG1GC
# make sure that the hardcoded System.gc() or Runtime.gc() are ignored (rmi does this)
wrapper.java.additional.11=-XX:+DisableExplicitGC
# Initial Java Heap Size (in MB), when G1GC is used just set the init memory to the max memory
wrapper.java.initmemory=321280  
# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=1280

...

(warning)   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.

Determining the Required Java Metaspace or Perm Space Value

By default the Java Heap Space size is set to 128Mb/200Mb, 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.

Configuring the Java Perm/Metaspace Space Value

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 .for java 7 or for java 8:

-XX:MetaspaceSize=200M -XX:MaxMetaspaceSize=200M -XX:MinMetaspaceFreeRatio=0 -XX:MaxMetaspaceFreeRatio=100 

Monitoring the Memory Usage

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).

Or through Monitoring Servoy with JMX

 

Running big servers with big heaps for many Web/NGClients

For large heaps (more then 4G) that needs to handle quite a lot of Web or NGClients the vm needs some tuning to be able to handle this nicely.

Use the latest Java 8 and use the G1 Garbagabe collector for this and make sure that the initial heap and the maximum heap ist just set to the same value:

-server -Xms4G -Xmx4G -XX:+UseG1GC -XX:MetaspaceSize=200M -XX:MaxMetaspaceSize=200M -XX:MinMetaspaceFreeRatio=0 -XX:MaxMetaspaceFreeRatio=100 -XX:+DisableExplicitGC 

 

Where the 4G for the initial (Xms) and the max (Xmx) should be set to the maximum heap you want or can assign to the java vm.

Smart Client Memory Management

...