JDK6.0 performance regression: stuttering is back :(

Remember the old stuttering problem in earlier versions of JDK5.0? The one where the mouse pointer started jerking and sound crackled etc etc.? It was caused by high priority VM threads being mapped to realtime priority threads on Windows NT/XP systems.

Well, unfortunately it’s back in JDK6.0 and the workaround flags to map the JVM thread priorities have been removed.

Does anyone know what the new flags are to remap thread priorities? And would any kind soul from the JVM teams at Sun reading this care to paddle the ass of the developer who didn’t commit the fix to the 6.0 development stream when he did the 5.0 fix?

TIA,
Cas :slight_smile:

This shouldn’t be the case. The use of THREAD_PRIORITY_TIME_CRITICAL on Windows was removed in one of the JDK 5 update releases as you recall. The thread priority code in the Java HotSpot VM was completely rewritten in JDK 6, but I’ve looked at the code and it definitely should not be using the time critical priority by default.

Do you have a test case showing the problem on at least some systems?

Can you try to track this down somewhat further? -XX:-UseThreadPriorities disables the use of native thread priorities. -XX:CompilerThreadPriority=[1…10] adjusts the default thread priority for the JVM’s internal compilation threads. -XX:VMThreadPriority=[1…10] has the same effect for the internal thread which initiates and usually performs garbage collections. -XX:JavaPriority[1…10]_To_OSPriority=[1…10] supports the remapping of thread priorities in earlier releases.

[Edit: clarification]

I’d like to point out that if you happen to be specifying -XX:ThreadPriorityPolicy=1 you will get the stuttering behavior with JDK 6. However the default value for this argument is 0.

This is with no opts. The test case is pretty simple, just fire up the latest Eclipse (3.3M5eh I think) and do a full rebuild; yer mouse will be jerking around all over the shop.

The latest Eclipse launches a bit differently to before; you will want to specify -vm on the commandline to ensure it’s running the correct JVM:

C:\eclipse33m5eh\eclipse.exe -vm “C:\Program Files\Java\jre1.6.0\bin\javaw”

Cas :slight_smile:

And if you run the test from the command line? Do you have the same result?