java - 如何从aws弹性beantalk环境中获取堆转储
问题描述
我们正在从运行在 aws elastic beanstalk 中的 tomcat 容器内运行的 Spring Boot 应用程序中获取 OutOfMemoryError。那么我如何从弹性豆茎中获得堆转储?
https://stackoverflow.com/a/48110954/7024630 上面的答案建议了一种通过安装第三方依赖项来获取堆转储的方法,有没有办法直接从AWS Elastic Beanstalk 获取?
解决方案
试试这个检查 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:~/
推荐阅读
- javascript - 无法导入“@angular/material”模块
- makefile - 终端 - 为什么我会收到这个 makefile 错误?
- function - 锈——“?” 只能在返回 'Result' 的函数中使用
- android - MotionLayout keyTrigger 不能正常工作?
- swift - 在 ViewController 之间转换时使用 UIView.transition 和 UIView.AnimationOptions 时出现动画问题
- dataframe - macgien 学习中的数据类型
- ios - UIView 的cornerRadius 与 CAShapeLayer 不同
- c# - 了解 NPGSQL 和实体框架中一对多关系的行为
- asp.net-core - Blazor 客户端中非 Razor 文件的 gRPC 代码永远不会完成
- mongodb - 如何计算 MongoDB 日志中特定集合的 SELECT 查询请求总数?