World Map
Java Service Wrapper is the easiest way to make your product more reliable.
  • Free Trial
  • Buy Now
wrapper.java.initmemory Property

Index

wrapper.java.initmemory

Compatibility : 1.0.0
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM z/Linux

The initial amount of memory in megabytes that the JVM should allocate at startup. The default value is "0" (zero), which will cause the JVM's default value to be used.

If a non-zero value is specified for this property, then an appropriate -Xms parameter will be added to the Java command generated by the Wrapper. If specified, the initial memory must be less than or equal to the value set for the wrapper.java.maxmemory property.

If this property is set to "0" (zero), then it is also possible to specify the -Xms parameter manually using the wrapper.java.additional.<n> property.

This value can affect the startup time of the application. Startup time is optimized when this value is fairly close to the actual amount of memory required by the application once it has been started. The default value for Windows and Linux JVMs is usally 2Mb, but Solaris JVMs require a minimum of 3Mb. Valid values are in the range 1 to the value of the wrapper.java.maxmemory property, which itself does not have an upper limit.

Example: (3MB)
wrapper.java.initmemory=3

This property is provided as a convenience for most users, and also makes it possible to set relative memory sizes as described below. If you require more complicated memory configurations, this can be done using the wrapper.java.additional.<n> properties as follows:

Equivalent Example: (3MB)
wrapper.java.additional.1=-Xms3m

NOTE

Unless you really do know everything there is to know about memory and Garbage Collection in Java, I would recommend reading through the following document. It describes in detail how the initial and maximum memory values affect Java performance and also goes into detail about what can be done to improve that performance for a given application.

wrapper.java.initmemory.percent

Compatibility :3.3.0
Editions :Professional EditionStandard EditionCommunity Edition (Not Supported)
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM z/Linux

At times, it is necessary to set the memory thresholds relative to the amount of physical memory available on the system. This property accepts a percentage value between 1 and 100 which will translate into a size in MBs.

Example: (60%)
wrapper.java.initmemory.percent=60

In the above example (60%), if 1GB (1024MB) of memory is installed on the system, the initial memory will be set to 614MB (=1024 x 60%).

However for 32-bit versions of the Wrapper, the value will be calculated based on the minimum between the physical memory and 2048MB. If the machine has 4GB of memory, then the initial memory will be 1228MB (= 2048 x 60%).

NOTE

Java behaves very poorly if the JVM has any of its memory swapped so it is important to take the OS requirements and any other applications into account when deciding on a safe memory level.

NOTE

Since version 3.5.29 it is also possible to use the dynamic variable 'WRAPPER_SYSMEM_<P>' where <P> refers to the percentage of the physical memory available on the system.

Example: (60%)
wrapper.java.additional.1=-Xmx%WRAPPER_SYSMEM_60.0%

For details see the Environment Variables page.

Reference: Java Memory

Reference: Java Command