Speaking at Jfokus!

I’ve been invited to  present the following session at Jfokus:

Presentation: What to Expect from HotRockit

Oracle is converging the HotSpot and Oracle JRockit JVMs to produce a "best-of-breed JVM." Internally, the project is sometimes referred to as the HotRockit project. This presentation discusses what to expect from the converged JVM over the next two years and how this will benefit the Java community.

My session will take place in A2, at 14:00 on Wednesday the 15th of February. Looking forward to seeing you there!

Getting Rid of Unwanted Preference Pages in Eclipse

I recently wanted to get rid of a preference page I did not want to expose in Mission Control (an Eclipse RCP based application), and ended up with the following code in my ApplicationWorkbenchWindowAdvisor:

private void removeUnwantedPreferencesPages() {
    PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager();
    IPreferenceNode root = getRoot(pm);
    removePrefsPage(root, "org.eclipse.equinox.security.ui.category"); //$NON-NLS-1$
}


private IPreferenceNode getRoot(PreferenceManager pm) {
    try {
        Method m = PreferenceManager.class.getDeclaredMethod("getRoot", (Class[]) null); //$NON-NLS-1$
        m.setAccessible(true);
        return (IPreferenceNode) m.invoke(pm);
    } catch (Exception e) {
       LoggingToolkit.getLogger().log(Level.WARNING, "Could not get the root node for the preferences, and will not be able to prune unwanted prefs pages.", e); //$NON-NLS-1$
    }
    return null;
}

private void removePrefsPage(IPreferenceNode root, String id) {
    for (IPreferenceNode node : root.getSubNodes()) {
        logPrefsNode(node);
        if (node.getId().equals(id)) {
           root.remove(node);
           LoggingToolkit.getLogger().log(Level.INFO, String.format("Removed preference page %s (ID:%s)", node.getLabelText(), node.getId()));   //$NON-NLS-1$
        } else {
           removePrefsPage(node, id);
        }
    }
}

If you need to know the ID of the preference page you wish to remove, simply walk the tree and print all the nodes instead of removing selected ones.

Hope this helps someone. Blinkar

Could not enumerate processes (1) error?

With JRockit, you may sometimes see the following warning when starting the JVM (on Windows):

[WARN ][osal ] Could not enumerate processes (1) error=-1073738819
[WARN ][osal ] Could not add counter (null)\ for query
[WARN ][osal ] Failed to init virtual size counter

It may also look something like this:

[JRockit] WARNING: Could not initialize the virtualbytes counter, some functionality in jrockit.management.Memory will not be available. Message was: failed to create counter query. String was: (null)\Virtual Bytes

Or like this:

[JRockit] WARNING: Could not initialize the JVM process load counter, CPU load generated by the JVM will not be available. Message was: failed to create counter query. String was: (null)\% Processor Time

This means the JRockit cannot access the relevant PDH counters. Sometimes the counter is disabled, and then it can simply be re-enabled.  Worst case, the counters can be corrupt, and the metadata needs to be rebuilt from system backup store.

To check the status of the counters, open a command prompt as admin, and run lodctr /q, as follows:

C:\Windows\system32>lodctr /q
Performance Counter ID Queries [PERFLIB]:
Base Index: 0x00000737 (1847)
Last Counter Text ID: 0x00001572 (5490)
Last Help Text ID: 0x00001573 (5491)
[.NET CLR Data] Performance Counters (Enabled)
DLL Name: netfxperf.dll
Open Procedure: OpenPerformanceData
Collect Procedure: CollectPerformanceData
Close Procedure: ClosePerformanceData
First Counter ID: 0x00001092 (4242)
Last Counter ID: 0x0000109E (4254)
First Help ID: 0x00001093 (4243)
Last Help ID: 0x0000109F (4255)
[.NET CLR Networking] Performance Counters (Enabled)
DLL Name: netfxperf.dll
Open Procedure: OpenPerformanceData
Collect Procedure: CollectPerformanceData
Close Procedure: ClosePerformanceData
First Counter ID: 0x00001086 (4230)
Last Counter ID: 0x00001090 (4240)
First Help ID: 0x00001087 (4231)
Last Help ID: 0x00001091 (4241)
[.NET Data Provider for Oracle] Performance Counters (Enabled)
DLL Name: netfxperf.dll
Open Procedure: OpenPerformanceData
Collect Procedure: CollectPerformanceData
Close Procedure: ClosePerformanceData
First Counter ID: 0x00001068 (4200)
Last Counter ID: 0x00001084 (4228)
First Help ID: 0x00001069 (4201)
Last Help ID: 0x00001085 (4229)

If it says (Disabled) next to a provider, the provider can be enabled with:

C:\Windows\system32>lodctr /e:<provider name> (where <provider name> is the string between the brackets at the beginning of the entry).

If the performance counters still behave badly, rebuild them from system backup store by running:

C:\Windows\system32>lodctr /r

Some counters may still be disabled after this. Use lodctr /q and lodctrl /e as described above to enable the ones you need.

If lodctrl is not available on your version of Windows, this article may help.

Java One Latin America Schedule Update

Since there was a bit of overlap in the previous schedule, my session has been moved to 14:15. The Hands-On-Lab remains at 11:15. These are the new times for my sessions:

Wednesday, December 7
Time Room Title Abstract Type
11:15 – 13:15
Mezannine: Room 1 Production-Time Problem Solving This tutorial looks at some common problems and pitfalls in Java applications. It focuses on noninvasive profiling and diagnostics of running production systems. Problems tackled:

  • Excessive GC
  • Finding hotspots and optimizing them
  • Optimizing the choice of data structures
  • Synchronization problems
  • Finding out where exceptions are thrown
  • Finding memory leaks
  • The presentation demonstrates all problems and solves them, running both the bad-behaving applications and the tools to analyze them from within the Eclipse Java IDE with the upcoming Oracle JRockit Mission Control Release 4.1.

    Hands-on Lab
    Java Core Platform
    14:15 – 15:15 Exposition Hall: Auditorium 6 HotRockit: What to Expect from Oracle’s Converged JVM Oracle is converging the HotSpot and Oracle JRockit JVMs to produce a “best-of-breed JVM.” Internally, the project is sometimes referred to as the HotRockit project. This presentation discusses what to expect from the converged JVM over the next two years and how this will benefit the Java community.
    Conference Session
    Core Java Platform

    Looking forward to seeing you there! Ler

    image

    JavaOne 2011–Sao Paulo

    I will be presenting the following two sessions at Java One in Brazil in December:

    Wednesday, December 7
    Time Room Title Abstract Type
    11:15 – 13:15
    Mezannine: Room 1 Production-Time Problem Solving

    This tutorial looks at some common problems and pitfalls in Java applications. It focuses on noninvasive profiling and diagnostics of running production systems. Problems tackled:

  • Excessive GC
  • Finding hotspots and optimizing them
  • Optimizing the choice of data structures
  • Synchronization problems
  • Finding out where exceptions are thrown
  • Finding memory leaks
  • The presentation demonstrates all problems and solves them, running both the bad-behaving applications and the tools to analyze them from within the Eclipse Java IDE with the upcoming Oracle JRockit Mission Control Release 4.1.

    Hands-on Lab
    Java Core Platform
    12:30 – 13:30 Exposition Hall: Auditorium 6 HotRockit: What to Expect from Oracle’s Converged JVM Oracle is converging the HotSpot and Oracle JRockit JVMs to produce a "best-of-breed JVM." Internally, the project is sometimes referred to as the HotRockit project. This presentation discusses what to expect from the converged JVM over the next two years and how this will benefit the Java community.
    Conference Session
    Core Java Platform

    Looking forward to seeing you there! Ler

    image

    WordFeud Word Generator

    My friend complained that his app for generating Swedish words did not work with Swedish characters. I complained that he should not be using such an app to begin with, but was challenged into whipping together this:

    http://hirt.se:8080/WordFinderWeb/

    I don’t recommend using this, as it really is cheating. If you are using this, let the friend you are playing with know! It really changes the character of the game to a pure strategy game.

    Time Problem When Dual-Booting Your Mac?

    I’ve been the proud owner of a Mac Book Air for a little while now. Because of work, I am dual booting it into Windows. A major annoyance, however, has been that everytime I switch to Windows, the Windows system clock has jumped two hours back in time (difference between CEST and UTC).

    There reason is that Mac OS X is expecting the real time clock (RTC) to be in UTC, and Windows expects it to be in local time. Luckily, there is a simple fix to this (if you are using Vista SP 2 or Windows 7). Simply set the registry key DWORD value to 1: HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal

    This will make Windows use UTC for the real time clock as well!

    For more information:
    http://www.insanelymac.com/forum/index.php?showtopic=226287
    http://linux.wxs.ro/2011/05/16/windows-rtc-utc/

    JavaOne / Oracle Open World 2011 Update

    There has been a slight update to the schedule. The HOL on Wednesday has been moved to 10:15. The finalized schedule is thus:

    This year my sessions are:

    Day Time TItle Location Type Length Session ID
    Monday 11:00 Production-Time Problem Solving

    Hilton San Francisco – Franciscan Room A/B/C/D

    HOL 2h

    22220

    Monday

    14:30

    HotRockit: What to Expect from Oracle’s Converged JVM

    Hilton San Francisco – Yosemite A/B/C

    Session

    1h

    22260

    Tuesday 13:30

    What’s New in Oracle JRockit Mission Control?

    Parc 55 – Market Street

    Session 1h

    22261

    Wednesday 10:15

    Production-Time Problem Solving

    Marriott Marquis – Salon 3/4

    HOL 1h

    31140

    Other sessions by the JRockit gang include:

    Day Time TItle Location Type Length Session ID
    Tuesday 20:30

    Meet the JDK Project Leads

    Hilton San Francisco – Plaza A/B

    BoF 45min 25148
    Wednesday 10:00 Showdown at the JVM Corral: Java 7 Edition

    Hilton San Francisco – Plaza A/B

    Panel 1h 23832

    Looking forward to seeing you in San Francisco! Smile    

     J12011OOW2011

    register_now_banner