Calculating and setting VM parameters in Unix comandline

Hi, I have Python based routine that calls snap tools via gpt and it is all packaged as a Docker container. The user will run it using the VirtualBox VM, with different amounts of base memory available for different users. I am wondering if there is a way to calculate and set the Snap VM parameters in a command line to optimize the performance based on the memory available. Can anyone help?

You can modify the snappy.ini file by script.
Change the line
# java_max_mem: 4G
to e.g.
java_max_mem: 6G

The value could be computed by the (Python) script based on the memory available.

There is also the snap-conf-optimiser. Which can be used to find a suitable configuration. But this is not really applicable in your case, because it doesn’t change the configuration of snappy/jpy.