Any arguments passed to flatpak-run
are passed to the java script in the flatpak but that in turn passes them to JOSM rather than to Java so that doesn’t help.
What does work is using JAVA_OPTS
to pass options that are then given to java, which can either be done in the environment:
JAVA_OPTS=-Xmx2G flatpak run org.openstreetmap.josm
or with an argument to flatpak-run
:
flatpak run --env=JAVA_OPTS=-Xmx2G org.openstreetmap.josm
Note that if your machine has more than 8Gb of RAM then it will default to options of -XX:MaxRAMPercentage=75.0 -Xms256m
which allows up to 75% of RAM to be used so this should only really be needed for machines with less than 8Gb of memory.