`
androider
  • 浏览: 752118 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

jvm之JPS

阅读更多
PARAMETERS

    options
        Command-line options.
    hostid
        The host identifier of the host for which the process report should be generated. The hostid may include optional components that indicate the communications protocol, port number, and other implementation specific data.

DESCRIPTION

    The jps tool lists the instrumented HotSpot Java Virtual Machines (JVMs) on the target system. The tool is limited to reporting information on JVMs for which it has the access permissions.

    If jps is run without specifying a hostid, it will look for instrumented JVMs on the local host. If started with a hostid, it will look for JVMs on the indicated host, using the specified protocol and port. A jstatd process is assumed to be running on the target host.

    The jps command will report the local VM identifier, or lvmid, for each instrumented JVM found on the target system. The lvmid is typically, but not necessarily, the operating system's process identifier for the JVM process. With no options, jps will list each Java application's lvmid followed by the short form of the application's class name or jar file name. The short form of the class name or JAR file name omits the class's package information or the JAR files path information.

    The jps command uses the java launcher to find the class name and arguments passed to the main method. If the target JVM is started with a custom launcher, the class name (or JAR file name) and the arguments to the main method will not be available. In this case, the jps command will output the string Unknown for the class name or JAR file name and for the arguments to the main method.

    The list of JVMs produced by the jps command may be limited by the permissions granted to the principal running the command. The command will only list the JVMs for which the principle has access rights as determined by operating system specific access control mechanisms.

    NOTE: This utility is unsupported and may not be available in future versions of the JDK. It is not currently available on Windows 98 and Windows ME platforms.

OPTIONS

    The jps command supports a number of options that modify the output of the command. These options are subject to change or removal in the future.

    -q
        Suppress the output of the class name, JAR file name, and arguments passed to the main method, producing only a list of local VM identifiers.
    -m
        Output the arguments passed to the main method. The output may be null for embedded JVMs.
    -l
        Output the full package name for the application's main class or the full path name to the application's JAR file.
    -v
        Output the arguments passed to the JVM.
    -V
        Output the arguments passed to the JVM through the flags file (the .hotspotrc file or the file specified by the -XX:Flags=<filename> argument).
    -Joption
        Pass option to the java launcher called by jps. For example, -J-Xms48m sets the startup memory to 48 megabytes. It is a common convention for -J to pass options to the underlying VM executing applications written in Java.

HOST IDENTIFIER

    The host identifier, or hostid is a string that indicates the target system. The syntax of the hostid string largely corresponds to the syntax of a URI:

    [protocol:][[//]hostname][:port][/servername]

    protocol
        The communications protocol. If the protocol is omitted and a hostname is not specified, the default protocol is a platform specific, optimized, local protocol. If the protocol is omitted and a hostname is specified, then the default protocol is rmi.
    hostname
        A hostname or IP address indicating the target host. If hostname is omitted, then the target host is the local host.
    port
        The default port for communicating with the remote server. If the hostname is omitted or the protocol specifies an optimized, local protocol, then port is ignored. Otherwise, treatment of the port parameter is implementation specific. For the default rmi protocol the port indicates the port number for the rmiregistry on the remote host. If port is omitted, and protocol indicates rmi, then the default rmiregistry port (1099) is used.
    servername
        The treatment of this parameter depends on the implementation. For the optimized, local protocol, this field is ignored. For the rmi protocol, this parameter is a string representing the name of the RMI remote object on the remote host. See the -n option for the jstatd command.

OUTPUT FORMAT

    The output of the jps command follows the following pattern:

    lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]

    Where all output tokens are separated by white space. An arg that includes embedded white space will introduce ambiguity when attempting to map arguments to their actual positional parameters.

    NOTE: You are advised not to write scripts to parse jps output since the format may change in future releases. If you choose to write scripts that parse jps output, expect to modify them for future releases of this tool.

EXAMPLES

    This section provides examples of the jps command.

    Listing the instrumented JVMs on the local host:

    jps

    18027 Java2Demo.JAR

    18032 jps

    18005 jstat


    Listing the instrumented JVMs on a remote host:

    This example assumes that the jstat server and either the its internal RMI registry or a separate external rmiregistry process are running on the remote host on the default port (port 1099). It also assumes that the local host has appropriate permissions to access the remote host. This example also includes the -l option to output the long form of the class names or JAR file names.

  
 jps -l remote.domain

    3002 /opt/jdk1.5.0/demo/jfc/Java2D/Java2Demo.JAR

    2857 sun.tools.jstatd.jstatd


    Listing the instrumented JVMs on a remote host with a non-default port for the RMI registry

    This example assumes that the jstatd server, with an internal RMI registry bound to port 2002, is running on the remote host. This example also uses the -m option to include the arguments passed to the main method of each of the listed Java applications.
    jps -m remote.domain:2002

    3002 /opt/jdk1.5.0/demo/jfc/Java2D/Java2Demo.JAR

    3102 sun.tools.jstatd.jstatd -p 2002


分享到:
评论

相关推荐

    JVM性能调优监控工具jps、jstack、jmap、jhat、jstat使用详解.docx

    JVM性能调优监控工具jps、jstack、jmap、jhat、jstat使用详解 本文将对一些常用的 JVM 性能调优监控工具进行介绍,包括 jps、jstack、jmap、jhat、jstat 等工具的使用详解。这些工具对于 Java 程序员来说是必备的,...

    tomcat解决JPS不可用的问题

    Tomcat 解决 JPS 不可用的问题 在编译安装 JDK 以后,如果原来的 OpenJDK 没有卸载完毕,就会存在两个 JVM 虚拟机,需要定义以下默认的 JVM。 在使用 Tomcat 服务器时,经常会遇到 JPS 命令不可用的问题。JPS...

    JVM监控实例数 windows监控 线程测试 单例模式下测试JVM实例是否一个

    在Java开发中,JVM(Java Virtual Machine)是运行所有Java程序的核心,它负责解析字节码并执行。为了确保应用程序高效稳定地运行,开发者需要对JVM进行监控,了解其内部状态,如内存使用、线程活动等。本文将探讨...

    Java长期运行后, jps等工具无法连接jvm

    Java长期运行后,jps等工具无法连接jvm的原因和解决方法 Java长期运行后,jps等工具无法连接jvm是一个常见的问题,很多开发者都曾经遇到过这种情况。这种情况的出现使得故障诊断变得非常困难。那么,究竟是什么原因...

    jvm内存监控工具使用

    本文将深入探讨 VisualVM 及其集成的一系列命令行工具,包括 jps、jstat、jmap、jinfo、jstack 和 JConsole,帮助读者掌握 JVM 内存监控的核心技巧。 #### VisualVM:JVM 监控的全能工具 VisualVM 是一款功能强大...

    深入JVM内核—原理、诊断与优化视频教程-2.JVM运行机制

    10. **JVM诊断工具**:JDK提供了丰富的命令行工具,如jps(Java进程查看)、jstat(统计JVM各种数据)、jmap(内存映射工具)、jhat(堆转储分析)、jconsole(GUI监控工具)等,用于监控和诊断JVM的运行状态。...

    JVM调优工具命令详解.pdf

    利用JPS获取进程ID后,便可以通过JVM自带的jmap命令来进一步分析进程内存使用情况。jmap命令能够帮助开发者查看内存信息、实例个数以及占用内存的大小。具体使用方法如下: 1. jmap -histo &lt;pid&gt;:此命令可以查看...

    jvm课程ppt

    JDK提供了一系列的工具,如jps(Java进程查看)、jstat(统计信息)、jmap(内存映射)、jhat(堆分析)、jstack(线程堆栈快照)等,用于监控JVM的状态、分析性能问题和排查错误。 七、JVM内存模型 Java内存模型...

    jvm常用命令工具

    jps - JVM Process Status Tool **用途**:列出当前系统中正在运行的所有HotSpot虚拟机进程,并显示每个进程的PID及主类名。 **命令格式**: ``` jps [options] [hostid] ``` **执行示例**: ``` jps -l ``` **...

    JVM学习笔记(一)

    JVM(Java Virtual Machine)是Java语言的核心组成部分之一,它为Java程序提供了一个跨平台的运行环境。本篇学习笔记主要介绍如何利用一系列工具来查看和监控JVM的各种运行时信息,包括但不限于JVM进程与参数查看、...

    JVM与Hadoop介绍

    ### JVM与Hadoop介绍 #### 一、Java虚拟机(JVM)概述 Java虚拟机(JVM)是执行Java字节码...同时,Hadoop作为一种分布式计算框架,与JVM紧密相连,利用JVM的强大功能处理大规模数据集,是大数据处理领域的关键技术之一。

    jvm_jvm新手_jvm_

    - **加载**:将.class文件读入内存,并为之创建一个Class对象。 - **验证**:确保加载的类信息符合Java规范,避免安全问题。 - **准备**:为类的静态变量分配内存并初始化为默认值。 - **解析**:将符号引用转换...

    《JVM从入门到入魔》笔记.pdf

    3:JVM内存调优:JVM参数【标准参数、-X参数、-XX参数等】+常用命令【jps、jinfo、jstat、jstack、jmap】+常用工具【jconsole、jvisualvm、Arthas、MAT】+性能优化及总结+高并发场景分析+JVM性能优化指南。

    jvm参数设置

    2. **jps**: 显示当前Java进程中JVM的PID。 3. **jmap -heap PID**: 查看指定PID的JVM堆内存详细信息。 4. **jstat -gcutil PID**: 每隔500毫秒打印一次指定PID的JVM的GC利用率信息。 - **Eden**: 新生代中的...

    JVM思维导图

    JDK提供了一些JVM诊断工具,如jps(Java进程查看器)、jstat(统计监控工具)、jinfo(配置信息查询工具)、jmap(内存映射工具)和jhat(堆转储分析工具),帮助开发者定位和解决问题。 通过深入理解JVM的工作原理...

    JVM高级特性与最佳实践(第2版)+pdf+源码

    5. **性能调优**:JVM提供了丰富的命令行工具,如jps、jstat、jmap、jhat、jconsole等,用于监控和分析JVM状态。通过调整JVM参数(如-Xms, -Xmx, -XX:NewRatio等),可以优化内存分配、GC行为和线程设置,达到性能...

    关键业务系统JVM参数推荐

    禁用这一特性可以避免此类问题,但同时也意味着不能使用jps或jstat等工具,而是需要依赖JMX来进行监控。 7. **-XX:-UseCounterDecay** - 默认情况下,每次GC后JIT编译器都会将调用计数器砍半,这可能导致一些方法...

    JAVA JVM性能调优监控工具详解

    本文介绍了两种常见的JVM性能调优监控工具——`jps`和`jstack`的基本使用方法及实际应用场景。这些工具可以帮助开发者快速定位问题所在,提高系统的稳定性和响应速度。此外,对于更复杂的性能问题,还可以结合其他...

    jvm监控工具介绍

    jps(Java Process Status)简单易用,用于列出系统中所有运行的JVM进程及其ID、启动路径等信息,是检查Java应用程序是否正常运行的快速方法。 8. **jstatd**: jstatd是JVM监控服务,它基于RMI(Remote Method ...

    网站地图查询同于jps

    而JPS,全称Java Process Status,是Java应用程序的一种监控工具,主要用来查看运行在Java虚拟机(JVM)上的所有进程的状态。在电子地图服务中,JPS可能用于监控后台服务的运行状况,确保地图数据的实时更新、定位...

Global site tag (gtag.js) - Google Analytics