If you need to set a different amount of ram in each execution, you can export it with the env var HEAP and then run your jmeter script.
HEAP
export HEAP="-Xms3g -Xmx3g -XX:MaxMetaspaceSize=1g" jmeter ...