Performance parameters |

### Performance parameters

#### System

- VM Parameters
  Parameters for the java virtual machine. These parameters are for advanced users and can be modified only by users having write access on the snap.conf file (in [SNAP_installation_folder]/etc/). They are taken into account after the application restarts. Most effective parameters for performance are -Xmx (maximum memory) and -Xms (initial memory), they are optimised when pressing the Compute button.
  To manually edit VM Parameters press the button.
  Please, note that these VM parameters are used when working with SNAP Desktop but not when executing GPT or PConvert tools. To modify the VM characteristics for this two tools, it is needed to edit manually the files gpt.vmoptions and pconvert.vmoptions (in [SNAP_installation_folder]/bin/) respectively.
- Data cache path
  SNAP application data cache path path. This path is used by SNAP processors and readers to store temporary files. Changing this path to a faster drive or RAM Drive can drastically improve performances for some operations.
  To browse threw the file system to manually change the data path, press the button
- Cache size
  Defines the default cache size in MB.
- Compute

  The compute button is calculating optimum memory and cache path parameters for your system

  - For Virtual Machine parameters, it compute "optimum" memory parameters:
    It sets the minumal memory to 2GB if enough memory is available. It computes the maximal memory using the total memory of the system, the memory taken by SNAP and the memory taken by other processes (OS, other applications, etc.). The maximum memory is configured so that SNAP can use all the free ram.
  - For Cache Path parameters, it computes the fastest directory by performing a benchmark on all drives, including network drives. The drive have to have enough free space and be significantly faster than the actual drive to be selected.
- Reset

  The reset button reload the initial parameters. After apply or valid your inputs, you can't reset to previous version.

#### Processing

This preferences page provides options to customize processing parameters. You can manually set processing parameters in SNAP Values or use the benchmark to compute faster processing parameters.

- SNAP Values
  There are two processing parameters that may affect processing performance:
  - Tile size
    Defines the default tile size.
  - Nb threads
    Sets the available number of threads. This value must not exceed your hardware number of cores.
- Benchmark

  To help you to define faster processing parameters, you can launch benchmarks.
  Follow these steps:

  - Select potential values

    You need to define a list of potential processing parameters for each values (tile size and nb threads).
    Each list must have at least one value, otherwise each values must be separated by a semi-colon (;).

  - Select a processing
    Select in the combobox the processing that will be used by the benchmark.
  - Set processing parameters

    Press the button Compute to launch the processing dialog, sets I/O and processing parameters and click Run.

  - Results

    The benchmark will compute the processing with all given parameters.
    It will display all results in a dialog window and save the faster parameters in SNAP Values.

- Reset

  The reset button reload the initial parameters. After apply or valid your inputs, you can't reset to previous version.

### Performance FAQs

#### I'm getting the Error "Cannot construct DataBuffer". What can I do?

This error indicates that you don't have enough memory. Either your system does not have enough memory (RAM) or the configuration for SNAP is not sufficient.
For the SNAP Desktop application, you can increase the amount of memory available to SNAP as explained above or:
In the 'etc' folder of the SNAP installation directory you'll find a file named snap.conf. Open it in a text editor.
There is the line which starts with 'default_options='
In this line you'll find an option like -J-Xmx5G. Increase the value. You could use something like -J-Xmx13G, if you have enough memory in your computer. By default, it is set to ~75% of the maximum value. This is usually a good choice.
If you experience the error on the command line with gpt or pconvert you need to change different files.
You need to change the corresponding vmoptions files, either gpt.vmoptions or pconvert.vmoptions.
Change the Value after -Xmx in the last line.

#### I'm getting the Error "Java heap space". What can I do?

The most common reason for this error is that SNAP just requires more Java heap space than available for the selected operator.
You can increase the amount of memory available to SNAP as explained above.
It is also possible that there are some not detected bugs that cause that some processes are not freeing up memory properly. In that case, perhaps restarting SNAP (if you have been executing other processes before) and trying again could work. But please, do not hesitate to report the error in the SNAP forum in order to help developers identify the bugs and fix them.