Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERDDAP Memory Question #37

Open
Dylan-Pugh opened this issue Jul 26, 2022 · 1 comment
Open

ERDDAP Memory Question #37

Dylan-Pugh opened this issue Jul 26, 2022 · 1 comment

Comments

@Dylan-Pugh
Copy link
Contributor

Dylan-Pugh commented Jul 26, 2022

Hi everyone - quick question about ERDDAP memory allocation. The default values for the ERDDAP_MIN_MEMORY & ERDDAP_MAX_MEMORY environment variables are currently different, but the ERDDAP documentation states that they should be the same:

The -Xmx and -Xms memory settings are important
because ERDDAP works better with more memory. Always set -Xms to the same value as -Xmx.

From docker-compose.yaml:

   environment:
      ERDDAP_MIN_MEMORY: 1G
      ERDDAP_MAX_MEMORY: 2G

My understanding is that (if set) these env variables are mapped to -Xmx and -Xms in setenv.sh:

NORMAL="-server -Xms${ERDDAP_MIN_MEMORY:-${MEMORY}} -Xmx${ERDDAP_MAX_MEMORY:-${MEMORY}}"

I also noticed this line from the documentation:

With 32 bit Java, even with abundant physical memory, Tomcat and Java won't run if you try to set -Xmx much above 1500M (1200M on some computers).

The current version of setenv.sh isn't passing the -d64 flag to enable 64 bit Java, so it seems like 2G (and the fallback value of 4G) would be too high for the max memory.

Are these potential problems? Or is this a case of the ERDDAP documentation being out of date?

Thanks!

@kwilcox
Copy link
Member

kwilcox commented Sep 8, 2022

The -Xmx and -Xms memory settings are important because ERDDAP works better with more memory. Always set -Xms to the same value as -Xmx.

This is a good general suggestion without getting into the whys and why nots and diving deep in java/tomcat tuning. Overall as long as -Xmx is high enough then ERDDAP/Java will eat that memory up when it needs to and overflow when it runs out. You should tune to your own experiences and when in doubt just set -Xms to whatever you are setting -Xmx to.

The current version of setenv.sh isn't passing the -d64 flag to enable 64 bit Java, so it seems like 2G (and the fallback value of 4G) would be too high for the max memory.

Recent JVMs detects this so it isn't required to explicitly pass in, although it can't hurt!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants