United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7022407 Spinning CPU in LocaleObjectCache.get()
JDK-7022407 : Spinning CPU in LocaleObjectCache.get()

Details
Type:
Bug
Submit Date:
2011-02-25
Status:
Resolved
Updated Date:
2012-03-20
Project Name:
JDK
Resolved Date:
2011-08-16
Component:
core-libs
OS:
linux,windows_7
Sub-Component:
java.util:i18n
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Duplicate:

Sub Tasks

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
PUBLIC COMMENTS

Did this just start with build b130?
                                     
2011-02-25
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.
                                     
2011-05-25
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.
                                     
2011-06-01



Hardware and Software, Engineered to Work Together