Xmx settings in elasticbean stalk through environment properties

左心房为你撑大大i 提交于 2021-01-28 13:30:54

问题


I had been trying to up the memory of my elastic beanstalk console using JAVA_OPTS in environment settings with values -Xms1G -Xmx3G. Attached is the image on how I have changed the settings. AFter applying the changes and restarting the vm, I do not see the changes refelcted on the server.

This is how I am verifying

sudo jmap -heap

Heap Configuration:
   MinHeapFreeRatio         = 0
   MaxHeapFreeRatio         = 100
   MaxHeapSize              = 1035993088 (988.0MB)
   NewSize                  = 21495808 (20.5MB)
   MaxNewSize               = 344981504 (329.0MB)
   OldSize                  = 43515904 (41.5MB)
   NewRatio                 = 2
   SurvivorRatio            = 8
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 1073741824 (1024.0MB)
   MaxMetaspaceSize         = 17592186044415 MB
   G1HeapRegionSize         = 0 (0.0MB)

Heap Usage:
PS Young Generation
Eden Space:
   capacity = 192413696 (183.5MB)
   used     = 18710296 (17.843528747558594MB)
   free     = 173703400 (165.6564712524414MB)
   9.723993867879342% used
From Space:
   capacity = 26738688 (25.5MB)
   used     = 22166296 (21.139427185058594MB)
   free     = 4572392 (4.360572814941406MB)
   82.89971445121017% used
To Space:
   capacity = 27262976 (26.0MB)
   used     = 0 (0.0MB)
   free     = 27262976 (26.0MB)
   0.0% used
PS Old Generation
   capacity = 691011584 (659.0MB)
   used     = 571332904 (544.8655166625977MB)
   free     = 119678680 (114.13448333740234MB)


回答1:


Heap settings cannot be set through environment properties. You have to give this via Procfile. The procfile has tobe bundled when uplaoding. I had to created a zip file that had war and Procfile. Proc file contents

web: java -jar -Xms1G -Xmx3G application.war

How to test this works? Find the process id of your webapp/java process from top. Use jmap heap - to get the heap allocation. I tested this on AWS-Ec2 for elastic beanstalk



来源:https://stackoverflow.com/questions/62655371/xmx-settings-in-elasticbean-stalk-through-environment-properties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!