systemadmin.es > Aplicaciones > jps – ps de procesos java

jps – ps de procesos java

Mediante el comando jps, presente dentro del directorio bin de JAVA_HOME, podemos simplificar la identificación de procesos java

Si lo ejecutamos sin argumentos podemos obtener el PID del proceso y la clase en ejecución:

# /usr/java/latest/bin/jps 
10107 Bootstrap
10164 Bootstrap
26695 Jps
2122 Bootstrap

Mediante la opción -m podemos ver las opciones pasadas a la clase principal:

# /usr/java/latest/bin/jps -m
10107 Bootstrap start
10164 Bootstrap start
2122 Bootstrap start
26735 Jps -m

La opción -l nos sirve para ver también el package de la clase:

# /usr/java/latest/bin/jps -l
10107 org.apache.catalina.startup.Bootstrap
10164 org.apache.catalina.startup.Bootstrap
26755 sun.tools.jps.Jps
2122 org.apache.catalina.startup.Bootstrap

Con la opción -v podemos ver también las opciones pasadas a la maquina virtual de java (JVM):

# /usr/java/latest/bin/jps -v
10107 Bootstrap -Djava.util.logging.config.file=/opt/tomcat-www/conf/logging.properties -Dcatalina.base=/opt/tomcat-www -Xms1280m -Xmx2G -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -Djava.library.path=/usr/local/apr/lib -Dcountry=www -Denvironment=prod -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/opt/tomcat-www/conf/jmx-access/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/opt/tomcat-www/conf/jmx-access/jmxremote.access -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/tomcat/endorsed -Dcatalina.base=/opt/tomcat-www -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat-www/temp
10164 Bootstrap -Djava.util.logging.config.file=/opt/tomcat-usa/conf/logging.properties -Dcatalina.base=/opt/tomcat-usa -Xms1280m -Xmx2G -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -Djava.library.path=/usr/local/apr/lib -Dcountry=usa -Denvironment=prod -Duser.timezone=America/New_York -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9002 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/opt/tomcat-usa/conf/jmx-access/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/opt/tomcat-usa/conf/jmx-access/jmxremote.access -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/tomcat/endorsed -Dcatalina.base=/opt/tomcat-usa -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat-usa/temp
26992 Jps -Dapplication.home=/usr/java/jdk1.7.0_11 -Xms8m
2122 Bootstrap -Dnop -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/tomcat/endorsed -Dcatalina.base=/opt/tomcat-solr -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat-solr/temp

Evidentemente, todas estas opciones las podemos combinar para obtener la información que nos interese:

# /usr/java/latest/bin/jps -vl
10107 org.apache.catalina.startup.Bootstrap -Djava.util.logging.config.file=/opt/tomcat-www/conf/logging.properties -Dcatalina.base=/opt/tomcat-www -Xms1280m -Xmx2G -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -Djava.library.path=/usr/local/apr/lib -Dcountry=www -Denvironment=prod -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/opt/tomcat-www/conf/jmx-access/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/opt/tomcat-www/conf/jmx-access/jmxremote.access -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/tomcat/endorsed -Dcatalina.base=/opt/tomcat-www -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat-www/temp
10164 org.apache.catalina.startup.Bootstrap -Djava.util.logging.config.file=/opt/tomcat-usa/conf/logging.properties -Dcatalina.base=/opt/tomcat-usa -Xms1280m -Xmx2G -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -Djava.library.path=/usr/local/apr/lib -Dcountry=usa -Denvironment=prod -Duser.timezone=America/New_York -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9002 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/opt/tomcat-usa/conf/jmx-access/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/opt/tomcat-usa/conf/jmx-access/jmxremote.access -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/tomcat/endorsed -Dcatalina.base=/opt/tomcat-usa -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat-usa/temp
27012 sun.tools.jps.Jps -Dapplication.home=/usr/java/jdk1.7.0_11 -Xms8m
2122 org.apache.catalina.startup.Bootstrap -Dnop -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/tomcat/endorsed -Dcatalina.base=/opt/tomcat-solr -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat-solr/temp

Deja un comentario:

XHTML - Tags permitidos:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>