Unable to set snap.jai.defaultTileSize as gpt option

Hi,
by tiping the following command

gpt -Dsnap.jai.defaultTileSize=256 --diag

it displays the following diagnostic information

SNAP Release version 7.0
[…]
Processors: 8
Max memory: 19.6 GB
Cache size: 1024.0 MB
Tile parallelism: 8
Tile size: 512 x 512 pixels

Therefore it seems I’m not able to set (as -D option) the tile size to values different than 512x512.
The problem arises on both Windows and Linux platform
Any suggestions?
Thanks in advance

Try adding the setting to <snap_install_dir>/bin/gpt.vmoptions.

Many thanks, it works! Sorry but now the question is: is it possible to specify a path for file gpt.vmoptions different than the default one? I would like to specify a different gpt.vmoptions file to use depending on the specific step to run?

Specifying JVM properties can be specified by prepending -J-D instead of just -D

Somehow just -D doesn’t work.

So you can do:

> gpt -J-Dsnap.jai.defaultTileSize=250 --diag
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
SNAP Release version 7.0
SNAP home: C:\Program Files\snap\bin\/..
SNAP debug: null
SNAP log level: null
Java home: c:\program files\snap\jre
Java version: 1.8.0_202
Processors: 12
Max memory: 9.8 GB
Cache size: 1024.0 MB
Tile parallelism: 12
Tile size: 250 x 250 pixels

Many Thanks, Marco: this is the solution I was looking for!