本文介绍了检查Elastic Beanstalk JVM堆的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从Elastic Beanstalk服务器获取JVM堆转储,但是该服务器没有jcmd或jmap. Amazon本身并未将其与JDK一起安装.这是安装的东西:

I'm need to get a JVM heap dump from an Elastic Beanstalk server, but the server doesn't have jcmd or jmap. Amazon doesn't natively install them with the JDK. Here's what's installed:

[ec2-user@ip-x-x-x-x ~]$ sudo yum list installed|grep jdk
java-1.7.0-openjdk.x86_64             1:1.7.0.111-2.6.7.2.68.amzn1 @amzn-updates
java-1.8.0-openjdk.x86_64             1:1.8.0.101-3.b13.24.amzn1   @amzn-updates
java-1.8.0-openjdk-headless.x86_64    1:1.8.0.101-3.b13.24.amzn1   @amzn-updates

从Elastic Beanstalk上的JVM获取堆转储的最佳方法是什么?

What's the best way to get a heap dump from the JVM on Elastic Beanstalk?

推荐答案

我发现您可以通过安装正确的软件包来安装jmap:

I have found you can install jmap by installing the correct package:

sudo yum install java-1.8.0-openjdk-devel

这至少应允许生成堆转储.

This should at least allow a heap dump to be generated.

此外,要确保jmap中的所有功能都运行,还请安装:

In addition, to make sure all functions in jmap run, also install:

sudo yum --enablerepo='*-debug*' install java-1.8.0-openjdk-debuginfo

尽管这可能取决于您使用的基准,tomcat版本等.

Although this might depend on the baseline, tomcat version etc you use.

创建堆转储时,请使用tomcat用户:

When creating a heap dump, use the tomcat user:

sudo -u tomcat jmap -dump:live,file=/tmp/test.hprof <pid>

这篇关于检查Elastic Beanstalk JVM堆的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 06:32