The script default is -Xmx1200M which is quite small these days (we can ignore 32-bit setups in choosing defaults).
We could simply leave it to the JVM default (25% of RAM).
- we don't want to squeeze out memory mapped files.
- 25% is a lot on larger servers if shared.
For TDB1/TDB2, a key use of memory in heap is the node table cache.
Other than that, it is intermediate query processing space.