[jboss-user] [Beginner's Corner] - Using jps and jstat with jboss

Willem Noorduin do-not-reply at jboss.com
Mon Jan 14 01:44:03 EST 2013


Willem Noorduin [https://community.jboss.org/people/willemnoorduin] created the discussion

"Using jps and jstat with jboss"

To view the discussion, visit: https://community.jboss.org/message/791429#791429

--------------------------------------------------------------
We are trying to set up some basic monitoring with jps and jstat and we are running into a problem. For usage of these tools there is a hsperfdata_${user} directory created by the jvm, by default in /tmp. Only in our case, it is not created. Hence we cannot use jps, jstat or the other jvm tools. Some information:

root at nlptc27b09:/tmp# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.3 (Santiago)

root at nlptc27b09:/tmp# uname -a
Linux nlptc27b09 2.6.32-279.11.1.el6.x86_64 #1 SMP Sat Sep 22 07:10:26 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
root at nlptc27b09:/tmp# /distr/jdk/bin/java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Server VM (build 20.2-b06, mixed mode)

root at nlptc27b09:/tmp# ls -ls /tmp
total 16
 0 drwxr-xr-x. 2 root     root       40 Jan 14 07:21 hsperfdata_root
12 -rwxr-xr-x. 1 root     root     8630 Dec 13 15:30 iptables
 4 -rwxr-xr-x. 1 root     root      324 Dec 13 12:53 iptables-ctl.sh
 0 drwxr-xr-x. 2 wnoordui users      40 Dec 12 10:20 iptables.d
 0 drwx------. 2 root     root       40 Dec 18 11:46 mc-root
 0 drwx------. 2 wnoordui wnoordui   40 Dec  3 09:44 mc-wnoordui
 0 drwx------. 2 root     root       40 Nov 14 10:53 vmware-root

root at nlptc27b09:/tmp# ls -ld /tmp
drwxrwxrwt. 8 root root 200 Jan 14 07:18 /tmp

We are running jboss under a non-root user (as it should) named jboss.  We have tried the next things, with different results:

* Running jboss under root. => Then the directory hsperdata_root is used and we get results (but you don't want that).
* Putting *-XX:+UsePerfData -Djava.io.tmpdir=/tmp* as Java options => has no results (there is no hsperdata_jboss, in our case, created).
* Switching to the last stable release of SUN/Oracle SDK => has no results (there is no hsperdata_jboss, in our case, created).
* Switching to OpenJDK on Redhat => Now we get a /tmp/hsperfdata_jboss (but we don't want to use OpenJDK for our production JBoss).
* Switching to another OS (Debian 6.0.6) and the same SUN JDK => Is working fine.
* Putting *-XX:+UsePerfData -Djava.io.tmpdir=/home/jboss/tmp* (where this last directory is writeable by user jboss)  as Java options => has no results (there is no hsperdata_jboss, in our case, created).

I am communicating with Redhat on this, since the swritch from SUN to OpenJDK or/and Redhat to another Linux OS seemed to do the trick, but all I learned was that it might be a permission issue. But:

root at nlptc27b09:/apps/jboss/test/configs# su - jboss
jboss at nlptc27b09:~$ cd /tmp
jboss at nlptc27b09:/tmp$ mkdir i-am-a-directory
jboss at nlptc27b09:/tmp$ touch i-am-a-directory/i-am-a-file
jboss at nlptc27b09:/tmp$ ls -lR i-am-a-directory/
i-am-a-directory/:
total 0
-rw-rw-r--. 1 jboss jboss 0 Jan 14 07:38 i-am-a-file

on Redhat says otherwise. Also, you can google all you want on this problem, all I found was ways to turn the perfstats off, not on. Can someone tell me where I went wrong ?  Also, the residental Linux Gurus on our team seems to point that this is really a java issue.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/791429#791429]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130114/c9c2e24d/attachment.html 


More information about the jboss-user mailing list