JDK-7022407 : Spinning CPU in LocaleObjectCache.get()
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux,windows_7
  • CPU: x86
  • Submitted: 2011-02-25
  • Updated: 2012-03-20
  • Resolved: 2011-08-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u4Fixed 8 b01Fixed
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b130)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b02, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux jorgen-thinkpad 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 x86_64 GNU/Linux

EXTRA RELEVANT SYSTEM CONFIGURATION :
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.7.0-ea
Java home: /usr/lib/jvm/jdk1.7.0-beta/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.28-11-generic" arch: "amd64" Family: "unix"


A DESCRIPTION OF THE PROBLEM :
Under some circumstances compiler the compiler spins 100% of one CPU forevrer. Each jstack dump tells me the thread is RUNNABLE at sun.util.locale.LocaleObjectCache.get(LocaleObjectCache.java:68):


"main" prio=10 tid=0x000000000069d000 nid=0x3270 waiting on condition [0x00007fff64bcf000]
   java.lang.Thread.State: RUNNABLE
	at sun.util.locale.LocaleObjectCache.get(LocaleObjectCache.java:68)
	at java.util.ResourceBundle$Control.getCandidateLocales(ResourceBundle.java:2304)
	at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1292)
	at java.util.ResourceBundle.getBundle(ResourceBundle.java:797)
	at com.sun.tools.javac.util.JavacMessages.getBundles(JavacMessages.java:114)
	at com.sun.tools.javac.util.JavacMessages.setCurrentLocale(JavacMessages.java:73)
	at com.sun.tools.javac.util.JavacMessages.<init>(JavacMessages.java:91)
	at com.sun.tools.javac.main.Main.getLocalizedString(Main.java:548)
	at com.sun.tools.javac.main.Main.resourceMessage(Main.java:491)
	at com.sun.tools.javac.main.Main.compile(Main.java:431)
	at com.sun.tools.javac.main.Main.compile(Main.java:329)
	at com.sun.tools.javac.main.Main.compile(Main.java:320)
	at com.sun.tools.javac.Main.compile(Main.java:94)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:613)
	at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:420)
	at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:141)
	at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:493)
	at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
	at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:613)
	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Have not been able to create a reliable reproduction yet.


REPRODUCIBILITY :
This bug can be reproduced occasionally.

Comments
EVALUATION There is some code in Locale cache management where it depends on the VM's GC behavior. It loops until the stale SoftReference is cleaned by the GC which could take very long time depending on VM's implementation.
01-06-2011

EVALUATION The code in question (and other related codes) haven't changed in the b130 build. Can the submitter please try it again with the latest JDK7 build? Also please describe the procedure how you reproduced (even if it is intermittent) the spin.
25-05-2011

PUBLIC COMMENTS Did this just start with build b130?
25-02-2011