2

OSX Lion, Java 1.6.0_33

One program running at the moment, shows CPU in jvisualvm

Overview:

Host: localhost
Main class: org.jetbrains.idea.maven.server.RemoteMavenServer
Arguments: <none>

JVM: Java HotSpot(TM) 64-Bit Server VM (20.8-b03-424, mixed mode)
Java: version 1.6.0_33, vendor Apple Inc.
Java Home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
JVM Flags: <none>

Another does not:

Host: localhost
Main class: com.basistech.ntt.SocialSecurityDeathMasterToDistribution
Arguments: /data/ssdm/SSDM.txt target/ssdm.dist.txt

JVM: Java HotSpot(TM) 64-Bit Server VM (20.8-b03-424, mixed mode)
Java: version 1.6.0_33, vendor Apple Inc.
Java Home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
JVM Flags: <none>

Heap dump on OOME: disabled

Why?

bmargulies
  • 97,814
  • 39
  • 186
  • 310
  • I can only assume that you need to command line argument added. This is not needed on windows or linux, but I can't imagine any other difference between your two programs. – Peter Lawrey Jul 02 '12 at 16:16
  • What command line argument would that be? I've posted the args to the happy program, and there are none that seem relevant. – bmargulies Jul 02 '12 at 16:17
  • One of the JMX permitions or authority perhaps, like I said this doesn't happen on windows or linux unless the jvisualvm is running as a different user to the process. I assume you are running everything as the same user? – Peter Lawrey Jul 02 '12 at 16:20
  • I see a similar result with application bundles in which the `Info.plist` specifies `1.5*`, but not when the jnlp specifies `1.5+`. Are you using `JavaApplicationStub`? – trashgod Jul 02 '12 at 16:32
  • Not at all. There are all launched with the java command, no stub. – bmargulies Jul 02 '12 at 17:18

1 Answers1

0

I'm not sure you still have the issue, but this answer might help others

I'm on linux and had exactly the same behaviour as yours :

  • local jvm cpu sampling disabled on some vm but working on others (jvisualvm itself for example)
  • when the cpu sampling was not working, jvisualvm would take 5-6 min to attach to the vm

in my /etc/hosts file, the 127.0.0.1 entry did not contain my hostname so i changed it from :

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

to

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 my_host_name

(my_host_name : what you get when you run the cmd : hostname).

(i tried it after reading point 5 of : http://docs.oracle.com/javase/1.5.0/docs/guide/management/faq.html which is not the issue i was facing, but as i was out of things to try... )

Before changing /etc/hosts the command : hostname -i returned my eth0 ip address. After it returned 127.0.0.1

I don't really understand why, but it fixed my issue.

Thierry
  • 5,270
  • 33
  • 39