3

I am trying to increase Java heap size in tomcat in a Beanstalk application. For that, I created a YAML config file (named tomcat.config) as follows:

option_settings:
  - namespace: aws:elasticbeanstalk:container:tomcat:jvmoptions
    option_name: Xms
    value: 256m
    option_name: Xmx
    value: 1024m
    option_name: XX:MaxPermSize
    value: 64m

I have placed this file within src/main/resources/.ebextensions/ directory.

When I deploy this war on tomcat, I don't see Xmx2014m in tomcat. What am I doing wrong?

Nik
  • 5,515
  • 14
  • 49
  • 75
  • 1
    You can configure the JVM heap size (min and max) on the configuration tab of the elastic beanstalk console. Not exactly an answer to your question, but it could help you get where you need to be. – Theyna Jul 24 '16 at 22:57
  • 1
    Thanks @Theyna. I got it to work after some trials. I guess I hadn't created the YAML properly. – Nik Jul 25 '16 at 17:03
  • always good to know you got something to work +1 – Theyna Jul 25 '16 at 19:57

2 Answers2

1

Here is what worked for me, in case anyone else needs the answer.

option_settings:
  - namespace: aws:elasticbeanstalk:container:tomcat:jvmoptions
    option_name: Xmx
    value: 1024m
Nik
  • 5,515
  • 14
  • 49
  • 75
  • The above config resides in `my-project-dir/src/main/resources/.ebextensions/tomcat.config`. – Nik Jul 25 '16 at 17:01
0

According to AWS Elastic Beanstalk documentation for Tomcat platform configuration, it can be done in this way:

option_settings:
  aws:elasticbeanstalk:container:tomcat:jvmoptions:
    Xms: 256m
    Xmx: 1024m

But in case you ever made any manual changes to those options in EB web console, those settings will always take precedence and corresponding option settings in extension config file will be ignored.

See this discussion: https://forums.aws.amazon.com/thread.jspa?messageID=403076&#403076

Oleksandr Shmyrko
  • 1,720
  • 17
  • 22