Logo Help Center

Elvis 5 memory configuration

Elvis 5 memory configuration

After the installation of Elvis 5 Server, sufficient memory should also be allocated to the Java Virtual Machine (JVM) instance in which Elvis Server itself is run, specifically to the Java heap memory.

In addition, in case elasticsearch is run in its own JVM instance, memory should be allocated to that instance.

Optimal Java heap size memory settings

The optimal performance settings for the initial and maximum Java heap memory size depends on whether or not Elvis Server is configured to act as a Search node:

Elvis Server acting as a Search node? Java heap size memory allocation
Maximum (-Xmx) Initial (-Xms)
Yes Allocate 25% of the machine's total with a minimum of 1GB Same as -Xmx
No Allocate about 40–50% of the machine's total with a minimum of 1GB Same as -Xmx

About the maximum Java heap memory (-Xmx)

The -Xmx option controls just the Java heap memory block. The actual Java process may use more memory because it also has blocks of non-heap and native memory. It is advisable to leave sufficient memory available for the operating system.

Note: Most modern operating systems will use any remaining memory to speed up the disk cache. This can hugely improve performance of the search engine.

Changing the Java heap settings

The following samples show how to modify the Java heap memory settings on all platforms. The samples assume a machine with the following configuration:

  • Amount of RAM: 16GB
  • Elvis Server acting as a Search node: yes

This results in about 4GB that can be assigned to the Java heap memory.

Note: For platforms with a higher or lower amount of memory, adjust the memory values according to the recommendations outlined above.

Tip: Use a converter to convert Gigabits to Megabits.

On Windows

  • Open the Jetty config in Notepad or another text editor.

<Program Files>\Elvis Server\elvis-service\elvis-service.conf

  • Change the following lines and save the changes:

wrapper.java.initmemory=4096

wrapper.java.maxmemory=4096

  • Restart Elvis Server.

On Mac OS X

  • Open the Terminal and type the following:

$ sudo nano /Library/LaunchDaemons/com.dutchsoftware.elvis.server.launchd.plist

  • Change the Xmx and Xms settings:

<string>-Xms4g</string>

<string>-Xmx4g</string>

  • Save the changes and exit by typing Ctrl+X followed by Y.
  • Restart Elvis Server.

On Linux

  • Type the following in the command line:

$ sudo nano /srv/elvis-server/app/wrapper/conf/wrapper.conf

  • Comment-out:

wrapper.java.initmemory=1024

wrapper.java.maxmemory=6144

  • At the end of the file, change.:

wrapper.java.additional.1 = -Xms4g

wrapper.java.additional.2 = -Xmx4g

  • Save the changes and exit by typing Ctrl+X followed by Y.
  • Restart Elvis Server.

Allocating memory to elasticsearch

In case elasticsearch is run in its own JVM instance (which is not the default configuration), memory should be allocated to that instance.

Info: This feature is supported in Elvis Server version 5.3.x to 5.11.x. Support for it has been dropped since Elvis 5.12.

Do this by modifying the -Xms and -Xmx options of the elasticsearch.jvmOptions setting in the node-config.properties.txt file:

Example: (Here, both options are set to 4GB)

elasticsearch.jvmOptions=-Xms4g,-Xmx4g,-Xss256k,-Djava.awt.headless=true

Was this article helpful?
0 out of 0 found this helpful / Created: / Updated:
Have more questions? Submit a request

5 Comments

  • 1
    Avatar
    Samuli Jokipaltio

    Please provide more memory allocation examples for a node that [also] processes assets. Tools that run, in addition of elvisserver: exiftool, ffmpeg, im, gm, libreoffice, ... require their own memory (AFAIK). And unfortunately, occasionally processing very large assets can cause memory starvation for elvis-server. 

    Examples:

    1. Large setup, process only OS X node with 16 GB RAM.
    Based on this article, java heap size is between 6.4 and 8 GB (40-50%). Why does the elvis-server process require so much memory? Should we not leave as much as possible memory free for processing tools?

    2. Small setup, all-roles Linux server with 16 GB RAM.
    Based on this, java heap size should be 4 GB (25%). I have seen a setup like this crash, when large camera raw or video files are imported. 

    3. Large setup, search-only Linux node with 128 GB RAM
    You recommend java heap size setting of 32G GB (25%). This sounds about right, but how can I be sure this is optimal? 

    Does a job-runner role require additional memory?

    For a running system, what are the indicators that could tell us to increase or decrease java heap size?

    Should we also take account the number of cores a server has - I'd assume a 16 core server would require more memory (running more threads and tools) than a 4 core server?

    And how can I be sure, that memory is optimally allocated in my processing-only nodes? 

  • 0
    Avatar
    Maarten van Kleinwee

    Hi Samuli,

    I have passed on your comments and feedback to the development team.

    Regards,

    Maarten van Kleinwee
    Senior Technical Writer, WoodWing Software

  • 0
    Avatar
    Sebastian Nafroth

    Hello Maarten,

     

    any progress here?

     

    Thank you.

  • 0
    Avatar
    Maarten van Kleinwee

    Hi Sebastian,

     

    Not yet unfortunately. I have brought it to the attention of the team once more. Apologies for the delay.

    Regards,

    Maarten van Kleinwee
    Senior Technical Writer, WoodWing Software

  • 0
    Avatar
    Sebastian Nafroth

    Any progress here?

     

    Thank you

Please sign in to leave a comment.