There are already several threads with this error.
You can add
-Xmx16G
to the gpt.vmoptions
files which is located in <SNAP_DIR>/bin
.
Additionally it might help if you use the -c option of gpt to increase the cache size used during processing.