3

Today I had a look at Mission Control introduced in Java 7 update 45 and tested a bit with Flight Recorder. Everything seems to be working as expected, I get a lot of data about threads, memory and whatever from the application I tested. Only one thing seems strange to me: In the category "General" there's no CPU usage shown, underneath the icon for the CPU usage there's only the sentence "No Events in Recording". When I don't use Flight Recording but the JMX Console, CPU usage is shown in the same application. During creation of the Flight Recording I left most of the settings as their default values, but made sure that on the page "Event Details for Profiling" "Operating System/Processor/CPU Load" is enabled and has a configured Period of 1000 ms, which should be enough to get some data using a test period of some minutes.

Is there anything that I'm missing? Maybe a restriction due to performance reasons, something else I need to activate?

Thanks for your suggestions!

Thorsten Schöning
  • 3,501
  • 2
  • 25
  • 46

3 Answers3

3

sorry for a bit of a late answer, but I think i know what might be your issue:

Are you running a localized version of Windows by any chance?

I managed to introduce a bug where I hardcoded a PDH Query path to use the "Process" PDH object string, like: "\Process(%s#%d)\%s". Of course, the "Process" string is not guaranteed on localized versions of Windows, it should have been resolved via the registry index instead.

I have fixed this in 9 and 8, i think there is backport in progress for 7 line as well.

Please see this bug: https://bugs.openjdk.java.net/browse/JDK-8043323

Thanks Markus

Markus
  • 46
  • 5
0

CPU load is enabled by default, in both templates that are shipped with the JVM (1000 ms).

Do you get the same problem if you don't modify settings in the advanced part of the wizard? If you just click Finish on a fresh template from the first page of the recording wizard?

Kire Haglin
  • 6,569
  • 22
  • 27
  • Yes, still the same without any changes for both default profiles and with different applications, e.g. Eclipse itself and DbVisualizer. – Thorsten Schöning Oct 25 '13 at 06:21
  • 1
    You could try to add -XX:FlightRecorderOptions=loglevel=trace to the command line. If the JVM is not able to get CPU Usage from the OS, for instance if performance counters is disabled in the registry on Windows, you should see it in the log. – Kire Haglin Oct 25 '13 at 12:21
  • You were right, I get the following errors: Unable to generate requestable event CPULoad Any idea why? I didn't have disabled perfomance counters and if I use the JMX Console I can see CPU usage of the JVM and "machine". – Thorsten Schöning Oct 25 '13 at 15:54
0

Thanks to the help of Kire Haglin I knew what to search for and found the following bugs:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019921

What I don't understand is that regarding the backport-Bugs the problem should have been fixed in u45:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8021038

But it still doesn't work for me and my applications like Eclipse, DbVisuliazer, Tomcat within Eclipse etc. Looks like I'll have a look if I'm able to reopen the bug.

My output of java -version:

Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)

suggests that "b53", as stated in the main bug, may be the next releases of JRE/JDK were the problem got fixed. One backport bug is targeted as JRE 7u60, too.

Thorsten Schöning
  • 3,501
  • 2
  • 25
  • 46
  • 1
    That bug was fixed in 7u40, but most likely it's perf-counter related. JMX uses another mechanism. I assume you have seen this, http://docs.oracle.com/cd/E15289_01/doc.40/e15066/knownissues.htm#CJAHCBDA as you said perf os counter were not disabled. Sorry, I can't be of more help. What version of WIndows are you? Are you running as administrator? – Kire Haglin Oct 26 '13 at 17:46
  • No, I didn't get your linked error messages in my trace log, only the CPULoad-sentence I mentioned before. I'm using Windows 7 64 Bit, fully updated and no, I'm not running as Administrator. Instead I'm using a user which is member of "Users", meaning if UAC pops up, I have to provide the password for an admin account. I will try as admin, thanks a lot for your help! – Thorsten Schöning Oct 26 '13 at 18:48
  • Running only JMC as admin doesn't work, because it doesn't see my processes started as a normal user. Adding my user to the group of Administrators didn't change anything, too, in this case it saw my processes, but still didn't record any CPU load. If I start JMC via UAC while my user still is a member of Administrators, JMC doesn't see any of my processes at all. Seems I'm stuck without CPU load, as even if it would have worked, starting all processes elevated using UAC wouldn't be an option at all. – Thorsten Schöning Oct 28 '13 at 08:33
  • 1
    Can you see CPU time in perfmon.exe? Performance Monitor -> Add -> Process -> select a JDK 7u40 instance -> User Time and Process Time. – Kire Haglin Oct 28 '13 at 23:06
  • Yes, this does work for different applications running a JRE as javaw.exe or eclipse.exe or dbvis.exe. But still no CPULoad events in JMC, even if I start JMC at first and each other application to test afterwards. I'm lost, I don't see what I'm doing wrong... :-/ – Thorsten Schöning Oct 29 '13 at 07:25
  • You could try to download JRockit and see if you can get CPU events. If you do, then it's a bug in Hotspot and not related to your OS environment. – Kire Haglin Oct 30 '13 at 21:18