cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can you use the Java Xmx and Xms options to limit the amount of memory used by the local license server (LLS)?

Can you use the Java Xmx and Xms options to limit the amount of memory used by the local license server (LLS)?

Summary

Can you use the Java Xmx and Xms options to limit the amount of memory used by the local license server (LLS)?

Question

Can you use the Java Xmx and Xms options to limit the amount of memory used by the local license server (LLS)?

Answer

By default, Java uses around 1/4th of system memory as a heap. The heap will grow up to that limit.
You should not compare 32 bit with 64 bit processes with regard to memory usage, as 32 bit processes cannot acquire memory more than 4GB (that's the limit). For example, it is not an adequate comparison to say a 64 bit JVM uses 8GB for x requests while a 32 bit JVM uses 4GB for x-thousand requests.

It is not required to set -Xmx in a production environment, but you could limit heap usage for your testing by supplying the -Xmx switch to Java.
E.g. java ?Xmx4g ?jar flexnetls.jar

Here are the results of one such in-house experiment (all tests were run on a 64 bit JVM)...
Wet -Xmx to something reasonable, e.g. -Xmx2g or -Xmx4g

For 10k requests.
Without -Xmx switch : 1.8GB
With -Xmx512m : 650MB

For 100k requests.
Without -Xmx switch : 1.8GB
With -Xmx512m : 791MB

Your numbers may vary, depending on the other factors like number of request per second, number of licenses requested etc.

Please note that, -Xms limits the heap usage only, but there are other factors involved in the JVM, such as native components, gc, etc.
Hence you would see extra memory usage apart from the enforced 512MB (which is normal). But the biggest one is JVM heap.

Also, once the JVM acquires the memory, it may not release it (even after the server is idle). Releasing/acquiring memory is an expensive operation, so the JVM tends to hang on to the acquired memory for future use.

Additional Information

You may have some customers who indicate the RAM usage is much higher than 1/4 of the system memory. In those situations, setting the Xmx limit can help.

You can pass these types of Java arguments to the license server when it is running as a service. For example, you can use the EXTRA_SYSPROPERTIES variable in flexnetls.settings to set the max heap size to 4G by using:

EXTRA_SYSPROPERTIES="-Xmx4G"

From the Java docs, -Xmx sets the maximum heap size, but the application can use more memory than that.

Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Nov 12, 2018 08:42 PM
Updated by: