1. <small id='rWWyE'></small><noframes id='rWWyE'>

        • <bdo id='rWWyE'></bdo><ul id='rWWyE'></ul>
      2. <i id='rWWyE'><tr id='rWWyE'><dt id='rWWyE'><q id='rWWyE'><span id='rWWyE'><b id='rWWyE'><form id='rWWyE'><ins id='rWWyE'></ins><ul id='rWWyE'></ul><sub id='rWWyE'></sub></form><legend id='rWWyE'></legend><bdo id='rWWyE'><pre id='rWWyE'><center id='rWWyE'></center></pre></bdo></b><th id='rWWyE'></th></span></q></dt></tr></i><div id='rWWyE'><tfoot id='rWWyE'></tfoot><dl id='rWWyE'><fieldset id='rWWyE'></fieldset></dl></div>

        <tfoot id='rWWyE'></tfoot>
        <legend id='rWWyE'><style id='rWWyE'><dir id='rWWyE'><q id='rWWyE'></q></dir></style></legend>

        jps、jinfo、jstat、jmap和jstack如何获取本地Java进程的信息?

        How do jps, jinfo, jstat, jmap and jstack get information about local Java processes?(jps、jinfo、jstat、jmap和jstack如何获取本地Java进程的信息?)
        <i id='4GpTX'><tr id='4GpTX'><dt id='4GpTX'><q id='4GpTX'><span id='4GpTX'><b id='4GpTX'><form id='4GpTX'><ins id='4GpTX'></ins><ul id='4GpTX'></ul><sub id='4GpTX'></sub></form><legend id='4GpTX'></legend><bdo id='4GpTX'><pre id='4GpTX'><center id='4GpTX'></center></pre></bdo></b><th id='4GpTX'></th></span></q></dt></tr></i><div id='4GpTX'><tfoot id='4GpTX'></tfoot><dl id='4GpTX'><fieldset id='4GpTX'></fieldset></dl></div>

              <tbody id='4GpTX'></tbody>

            <small id='4GpTX'></small><noframes id='4GpTX'>

          • <tfoot id='4GpTX'></tfoot>

              <legend id='4GpTX'><style id='4GpTX'><dir id='4GpTX'><q id='4GpTX'></q></dir></style></legend>

                <bdo id='4GpTX'></bdo><ul id='4GpTX'></ul>
                • 本文介绍了jps、jinfo、jstat、jmap和jstack如何获取本地Java进程的信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  jps如何获取所有本地java进程的信息?它是否连接到某个本地服务器进程以获取信息?

                  jinfo、jstat、jmapjstack如何获取本地java进程的信息?他们是否连接到某些本地服务器进程以获取信息?

                  jstatd是否只用于提供对本地java进程的远程访问,而不用于提供对本地java进程的本地访问?p>

                  我正在运行 Ubuntu.我的问题来自 https://stackoverflow.com/a/55669949/156458.

                  解决方案

                  jps 通过扫描/tmp/hsperfdata_ 目录查找正在运行的Java 进程.每个基于 HotSpot 的 Java 进程都会在此目录中创建一个文件,其名称与进程 ID 相同.

                  文件 /tmp/hsperfdata_/ 包含 JVM 导出的各种计数器.这些计数器可以由外部进程读取.这正是 jstat 的工作原理.我在 JavaMagazine 文章.

                  所以,jstat 总是可以读取本地 Java 进程的计数器,但是为了能够监控远程机器,jstatd 需要运行.

                  jmapjstackjinfo 使用动态附加机制.这些实用程序通过 UNIX 域套接字连接到目标 JVM,并将相应的命令发送到 JVM.该命令由远程 JVM 本身执行.在此答案中查找有关动态附加的更多信息并在此演示文稿中.

                  How does jps get information about all the local java processes? Does it connect to some local server process to fetch the information?

                  How do jinfo, jstat, jmap, and jstack get information about a local java process? Do they connect to some local server process(es) to fetch the information?

                  Is jstatd only used for providing remote access to local java processes, but not for providing local access to local java processes?

                  I am running Ubuntu. My question comes from https://stackoverflow.com/a/55669949/156458.

                  解决方案

                  jps finds running Java processes by scanning through /tmp/hsperfdata_<username> directory. Each HotSpot-based Java process creates a file in this directory with the name equal to the process ID.

                  The file /tmp/hsperfdata_<username>/<pid> contains various counters exported by the JVM. These counters can be read by an external process. This is exactly how jstat works. I described jvmstat performance counters in the JavaMagazine article.

                  So, jstat can always read counters of a local Java process, but in order to be able to monitor a remote machine, jstatd needs to be running.

                  jmap, jstack and jinfo use Dynamic Attach mechanism. These utilities connect to the target JVM via UNIX-domain socket and send the corresponding command to the JVM. The command is executed by the remote JVM itself. Find more about Dynamic Attach in this answer and in this presentation.

                  这篇关于jps、jinfo、jstat、jmap和jstack如何获取本地Java进程的信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Bytecode features not available in the Java language(Java 语言中不可用的字节码功能)
                  ClassCastException because of classloaders?(ClassCastException 因为类加载器?)
                  How can I add a Javaagent to a JVM without stopping the JVM?(如何在不停止 JVM 的情况下将 Javaagent 添加到 JVM?)
                  Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )(无法在 32 位 JVM 上加载 64 位 SWT 库(替换 SWT 文件))
                  Encourage the JVM to GC rather than grow the heap?(鼓励 JVM 进行 GC 而不是增加堆?)
                  Why a sawtooth shaped graph?(为什么是锯齿形图形?)
                • <tfoot id='i9uBa'></tfoot>
                • <small id='i9uBa'></small><noframes id='i9uBa'>

                  <i id='i9uBa'><tr id='i9uBa'><dt id='i9uBa'><q id='i9uBa'><span id='i9uBa'><b id='i9uBa'><form id='i9uBa'><ins id='i9uBa'></ins><ul id='i9uBa'></ul><sub id='i9uBa'></sub></form><legend id='i9uBa'></legend><bdo id='i9uBa'><pre id='i9uBa'><center id='i9uBa'></center></pre></bdo></b><th id='i9uBa'></th></span></q></dt></tr></i><div id='i9uBa'><tfoot id='i9uBa'></tfoot><dl id='i9uBa'><fieldset id='i9uBa'></fieldset></dl></div>

                          <tbody id='i9uBa'></tbody>
                          <bdo id='i9uBa'></bdo><ul id='i9uBa'></ul>
                            <legend id='i9uBa'><style id='i9uBa'><dir id='i9uBa'><q id='i9uBa'></q></dir></style></legend>