AWS弹性Beanstalk – 设置JVM选项(堆空间)

huangapple go评论88阅读模式
英文:

AWS Elastic Beanstalk - Setting JVM Options (Heapspace)

问题

好的。

我在AWS Elastic Beanstalk上运行一个Java应用程序。我需要增加堆空间,通常我会通过 -Xmx 和 -Xms 来实现。

我如何在AWS上完成这个任务?

我以最简单的方式部署 - 上传一个jar文件并运行它。我在这里已经找到了这个解决方案:

https://stackoverflow.com/questions/48990349/not-able-to-set-jvm-heap-size-on-aws-elastic-beanstalk-java-se-platform

将Procfile与我的.jar文件一起打包成.zip文件在部署时被接受,但没有任何变化。我真的没有更多的想法,有人可以帮忙吗?

英文:

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:

https://stackoverflow.com/questions/48990349/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?

答案1

得分: 8

在尝试了几种不同的方法后(.Config文件或位于.zip中的Procfile,更改Serverside JVM的默认堆大小以及向beanstalk配置添加JAVA_OPTS),最终成功了。

不要使用“JAVA_OPTS”,只需添加
“_JAVA_OPTIONS”
并将值设置为
“-Xmx[size]m”([size]代表所需堆大小的字节表示)
到您的Beanstalk环境的配置中;它位于
“配置” -> “软件” -> “环境属性”。

希望这能为某人节省我用来找到答案的时间。

英文:

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.

huangapple
  • 本文由 发表于 2020年10月7日 21:23:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/64244969.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定