I’m using JBoss 7.1.3 with the following Java, Linux versions …
[dave@mymachine ~]$ java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
[dave@mymachine ~]$ uname -a
Linux mymachine.mydomain.org 4.1.99-99.88.amzn1.x86_64 #1 SMP Fri Feb 5 23:44:22 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
I want to figure out how much heap is being used (not the maximum amount, but what is currently being used). Sadly, on our machine I don’t have access to jmap or jstat. So I wanted to do a heap dump using “kill -3”. So I first got the pid of my boss process
[dave@mymachine ~]$ ps -elf | grep jboss
1 S root 1251 1 0 80 0 - 28870 - 07:03 ? 00:00:00 /bin/sh /etc/rc3.d/S84jboss start
4 S root 1254 1251 0 80 0 - 34424 - 07:03 ? 00:00:00 runuser -s /bin/bash jboss -c ulimit -S -c 0 >/dev/null 2>&1 ; LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=/var/run/jboss-as/jbos-as-standalone.pid /usr/java/jboss/bin/standalone.sh -c standalone.xml
4 S jboss 1255 1254 0 80 0 - 28271 - 07:03 ? 00:00:00 bash -c ulimit -S -c 0 >/dev/null 2>&1 ; LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=/var/run/jboss-as/jboss-as-standalone.pid /usr/java/jboss/bin/standalone.sh -c standalone.xml
0 S jboss 1256 1255 0 80 0 - 28272 - 07:03 ? 00:00:00 /bin/sh /usr/java/jboss/bin/standalone.sh -c standalone.xml
0 S jboss 1289 1256 3 80 0 - 603908 - 07:03 ? 00:18:26 /usr/java/default/bin/java -D[Standalone] -server -XX:+UseCompressedOops -Xms256m -Xmx1024m -XX:MaxPermSize=512m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml -Dorg.jboss.as.logging.per-deployment=false -Dorg.jboss.boot.log.file=/usr/java/jboss/standalone/log/boot.log -Dlogging.configuration=file:/usr/java/jboss/standalone/configuration/logging.properties -jar /usr/java/jboss/jboss-modules.jar -mp /usr/java/jboss/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=/usr/java/jboss -Djbos.server.base.dir=/usr/java/jboss/standalone -c standalone.xml
0 S 602 21746 20632 0 80 0 - 27615 pipe_w 16:46 pts/1 00:00:00 grep --color=auto jboss
and then I ran “kill -3” …
[dave@mymachine ~]$ sudo kill -3 1289 1256
but nothing prints out and no file is generated in the current directory. How do I generate a heap dump with my current constraints?