JAVA_OPTS ignored by Ubuntu systemd

I know this is not specifically caused by Metabase, but I think it makes sense to post the question here since anyone who would run Metabase on Debian/Ubuntu will run into this problem.

I followed the guide at https://www.metabase.com/docs/latest/operations-guide/running-metabase-on-debian.html

In the environment file /etc/default/metabase I have added:

JAVA_OPTS=-Xmx2g

Upon stopping and starting the service, the JVM still says it only has access to 1GB of RAM

INFO metabase.util :: Maximum memory available to JVM: 968.0 MB

I tried wrapping it in single quotes and double quotes. No luck.

@tuaris There's no JAVA_OPTS for default environments - it's called JAVA_TOOL_OPTIONS
I would probably generally recommend that you adjust the java ... command you are using to start Metabase with in the service instead.

1 Like