Summary:

In an environment with limited resources, the CRM Tomcat service may be unable to start.

Symptoms:

Errors may be visible in the Tomcat service logs (\CRM\tomcat\logs).

Error in commons-daemon log:

[2013-02-22 12:13:38] [error] CreateJavaVM Failed
[2013-02-22 12:13:38] [error] Failed to start Java
[2013-02-22 12:13:38] [error] ServiceStart returned 4

Error in crmtomcat2-stdout log:

2013-02-22 12:13:38 Commons Daemon procrun stdout initialized
Error occurred during initialization of VM
Could not reserve enough space for object heap

Cause:

This issue is caused by an inability to reserve enough space for all of the Java memory allocations when the Tomcat service starts. The memory required must be contiguous; it must be available in one unfragmented chunk.


Resolution:

The most straightforward way to resolve this issue is often to reduce the RAM in use on the machine, either by closing other applications (if the issue is being encountered on a demo machine), or by limiting the amount of memory being used. Typically, this will be done by placing a limit on the amount of RAM used by SQL Server, for two reasons:

    a) SQL Server attempts to use as much RAM as possible to increase performance. This may not be necessary, depending on the customer's usage profile and indexes.
    b) SQL Server may fail to release memory for other applications when requested to do so.

The other option is to alter the amount of memory that will be reserved by the Java Virtual Machine when the Tomcat service starts. The largest configurable memory allocation is the PermGen space, used for storing class and method objects. This allocation is set in the registry, in HKLM\SOFTWARE\<Wow6432Node>\Apache Software Foundation\Procrun 2.0\CRMTomcat7\Parameters\Java, under the Options key:

-XX:MaxPermSize=512m

This causes 512MB of memory to be allocated to the Java heap when the Tomcat service is started. If the required amount of memory is not available as a contiguous block, then the Java virtual machine will fail to start.

When installing Sage CRM, the installer will attempt to reduce the PermGen space allocation dynamically to 256MB and then 128MB should there be an issue starting the Tomcat service. If the customer does not intend to use all of the Tomcat-based features of Sage CRM (such as the Exchange integration), then they may safely reduce the PermGen space allocation in the registry, and restart the Tomcat service.