Cyprian Gracz
Cyprian Gracz

Reputation: 31

AWS Elastic Beanstalk and JAVA_OPTS

I have a java application which is deployed to Elastic Beanstalk. There are two environments: test and production, production is configured to use bigger instances than test. With the default config for java environment max heap size is around 1/4 of all instance RAM (for 2G RAM instance it's about 0.5G) and I'd like to increase it (-Xmx). Available options are:

Any ideas how to set -Xmx depending on environment / available memory size? Thanks

Upvotes: 3

Views: 1765

Answers (1)

chenrui
chenrui

Reputation: 9866

I think of two ways to resolve the issue:

  1. two sets of .ebextensions, one for test and one for prod, when you do the app package, just put .ebextensions under webapp folder, it will be picked up by Beanstalk

  2. customized catalina.sh to grep the free memory and adjust the -Xmx accordingly.

Upvotes: 1

Related Questions