简体   繁体   中英

AWS Elastic Beanstalk Tomcat - high memory usage

I have t2.nano (512MB RAM) Elastic Beanstalk instance but even after restart (app servers) and just few requests I start to receive 93 % of memory is in use. warnings and then instance stops responding, until it reboots itself.

When I reboot the instance and run watch -n 1 free -m I get the following

Every 1.0s: free -m                                     Sat Aug 27 14:15:19 2016

             total   used       free     shared    buffers     cached
Mem:           491        485          5          0          6         91
-/+ buffers/cache:        387        103
Swap:            0          0          0

which means I have only ~100MB at my disposal, out of 512MB, or?


On my localhost everything works just fine. I'm looking for a memory leak but can't really tell where is the problem because on my dev machine everything works just fine (heap dump after few hundreds requests is usually <50MB).

I'm using Tomcat 8 with Java 8 , Servlet 3.0 and Hibernate + JPA .

Not sure how to go about this?

Try to add some swap space before deploy your application.

dd if=/dev/zero of=/var/swapfile bs=1M count=512
mkswap /var/swapfile
chmod 0600 /var/swapfile
swapon /var/swapfile

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM