Hari Kishore
Hari Kishore

Reputation: 33

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?

Upvotes: 0

Views: 1487

Answers (1)

Adriano Aquino
Adriano Aquino

Reputation: 3

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 [email protected]:~/

Upvotes: 0

Related Questions