简体   繁体   中英

How to get heap dump from aws elastic beanstalk environment

We are getting OutOfMemoryError from a spring boot application running inside tomcat container hosted in aws elastic beanstalk. So how do i get heap dump from elastic beanstalk ?

https://stackoverflow.com/a/48110954/7024630 The above answer suggests a method by installing third-party dependency to get heap dump, is there any way around to get directly from AWS Elastic Beanstalk?

Try this Best method for inspecting Elastic Beanstalk JVM heap , it's worked for me.

In my case, I using a java 7:

$ which java
$ ls -lh /usr/bin/java
$ yum install java-1.7.0-openjdk-devel
$ yum --enablerepo='*-debug*' install java-1.7.0-openjdk-debuginfo
$ ps aux | grep tomcat
$ sudo -u tomcat jmap -dump:live,file=/tmp/test.hprof 12768
$ tar -czvf test.hprof.tar.gz /tmp/test.hprof
$ scp test.hprof.tar.gz xxxxxxxxxxxxx@x.y.z.w:~/

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