Axungia_Hominis
Axungia_Hominis

Reputation: 175

AWS Elastic Beanstalk - Setting JVM Options (Heapspace)

Good day.

I am running a Java Application on AWS Elastic Beanstalk. I have to increase the heapspace, normally I would do so via -Xmx and Xms.

How do I accomplish this on AWS?

I'm deploying it in the most simple way possible - uploading a jarfile and running it. I've already found this solution on here:

Not able to set JVM heap size on AWS Elastic Beanstalk Java SE Platform

Putting a Procfile into a .zip together with my .jar is accepted when deploying but changes nothing. I really am out of ideas, can anyone help?

Upvotes: 6

Views: 5602

Answers (1)

Axungia_Hominis
Axungia_Hominis

Reputation: 175

After trying several different things (.Config file or Procfile in .zip, changing the Serverside JVM's default heap size and Adding JAVA_OPTS to beanstalk configuration) it finally worked out.

Instead of "JAVA_OPTS", simply add "_JAVA_OPTIONS" with the value "-Xmx[size]m" ([size] representing the desired heap size in bytes) to your Beanstalk Environment's Configurations; it's found under "Configuration"->"Software"->"Environment Properties".

I hope this will save someone the time it took me to find out.

Upvotes: 10

Related Questions