【问题标题】:How to get heap dump from aws elastic beanstalk environment如何从aws弹性beantalk环境中获取堆转储
【发布时间】:2019-09-24 16:39:07
【问题描述】:

我们从运行在 aws elastic beanstalk 中托管的 tomcat 容器内的 spring boot 应用程序中获取 OutOfMemoryError。那么如何从弹性豆茎中获取堆转储?

https://stackoverflow.com/a/48110954/7024630 上面的答案建议了一种通过安装第三方依赖来获取堆转储的方法,有没有办法直接从 AWS Elastic Beanstalk 获取?

【问题讨论】:

    标签: java spring-boot tomcat out-of-memory amazon-elastic-beanstalk


    【解决方案1】:

    试试这个Best method for inspecting Elastic Beanstalk JVM heap,它对我有用。

    就我而言,我使用的是 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:~/
    

    【讨论】:

      猜你喜欢
      • 2021-01-07
      • 2017-11-25
      • 2020-12-26
      • 2015-05-13
      • 2021-01-17
      • 2020-02-13
      • 2017-07-15
      • 2021-11-21
      • 2017-09-29
      相关资源
      最近更新 更多