複数の Java スレッドが HashMap に同時にアクセスするため CPU が高くなる
Issue
- スタックトレースの最上部を確認すると見つかる HashMapにアクセスしているスレッド群が、CPU やスレッド使用率の多くを占有しています。たとえば、以下のようなスタックトレースです。
"RMI TCP Connection(4468)-160.57.110.76" daemon prio=6 tid=0x5a436400 nid=0x9e4 runnable [0x6068d000]
java.lang.Thread.State:RUNNABLE
at java.util.HashMap.get(HashMap.java:303)
at com.example.service.getWidget(Component.java:796)
...
"WorkManager(3)-122" daemon prio=6 tid=0x5b496000 nid=0x18fc runnable [0x70b2e000]
java.lang.Thread.State:RUNNABLE
at java.util.HashMap.get(HashMap.java:303)
at com.example.service.getWidget(Component.java:796)
...
Environment
- Java
- JBoss Enterprise Application Platform (EAP)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
