Server Memory Management

The Java application server (cwas.exe) which runs in the background has a default memory allocation of 1024 MB.

This is also known as Heap memory.

Recommendations

A general recommendation is to have 500MB per application. Each folder that is created in the webapps directory has its own context which means resources aren't shared, i.e. the ROOT and samples directories. 
The amount of memory required will also be increased depending on the number of users and size of requests. 

Once the JVM (Java Virtual Machine) of the Cubewise Application Server has reached this value, it will slow down because it has to make some spaces for the new objects by deleting unused objects in order to keep the memory below 1024 MB, this is called garbage collector.

Update JVM maximum memory

The current default value is 1,024 MB and can be changed by updating the registry value:

  • Open a command prompt as an administrator:
  •  Go to the CWAS bin folder:
    • cd C:\CWAS\bin
  • Open the Cubewise Application Server properties using the command:
    • tomcat7w.exe //ES//CWAppServer

You should now see the properties window, go to the Java tab :

  • Update the value and click OK.

Restart the Cubewise Application Server.

Update PermGen Allocation

There is another type of memory that the JVM uses, and this is referred to as PermGen. in a brief description, the Heap memory configured above, stores the actual objects generated, whereas the PermGen memory stores the metadata about the generation of these objects.

The default allocation is 64Mb. There will be cases however that you will have encountered an OutOfMemory error, where PermGen will be indicated on the log file. On situations similar to these, you can add another parameter to increase this PermGen by appending the following into the Java Options:

-XX:PermSize=256m
-XX:MaxPermSize=2560m

The max value here should generally be around 25-40% of your allocated Heap memory.

Your Java Options now look similar to this:

Restart the Cubewise Application Server service on update.