I've deployed a Java webap to AWS Elastic Beanstalk and every few days, sometimes more often I get notified:
AWS Elastic Beanstalk Notification - Adding instance i-5dc46494 to your environment
a few minutes later:
Message: Removed instance 'i-60a05f96' from your environment. (Reason: Instance is in 'shutting-down' state)
First, is there somewhere I can look to find out the reason it needs to replace the current instance?
Second, last time it did this I was logged in and did a 'dmesg' just before it shut down:
[4383952.557902] Out of memory: Kill process 1608 (java) score 796 or sacrifice child
[4383952.557910] Killed process 1608 (java) total-vm:2496244kB, anon-rss:482052kB, file-rss:0kB
Probably the reason. What memory is it refering to here? the memory allocated to the JVM or the memory for the instance?
I also ran top and free -m
[ec2-user@ip-172-31-40-184 tomcat8]$ free -m
total used free shared buffers cached
Mem: 592 574 17 0 13 41
-/+ buffers/cache: 520 71
Swap: 0 0 0
here is pid 1608
[ pid ] uid tgid total_vm rss nr_ptes swapents oom_score_adj name
[ 1608] 91 1608 624061 120513 332 0 0 java
Any insight on what is happening would be appreciated. thanks!