STUCK Thread on java.util.HashMap.get method | Weblogic

Oracle Weblogic Server

Scenario:
———-
when system is running under heavy load you start experiencing a lot of STUCK threads.
All of the threads are stuck in the java.util.HashMap.get method.

Env. Info:
———–
You are using JDK 1.6.0_24.
You are using WLS 10.3.0.

Sample Error in Logs:
———————–

"STUCK ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE

java.util.HashMap.get(HashMap.java:303)

-------------------------
-------------------------
-------------------------
weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)

weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)

weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)

weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4547)

weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)

weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)

weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)

weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5058)

weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)

weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)

weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

 

Cause:
This is a bug in the deployed application code. They have corrupted the hashmap by adding to it in an unsynchronized way. When two threads are adding to the HashMap at the same time and both threads try to resize the hashmap at the same time, that will cause the internal next pointers for two entries to point back to each other. This will cause infinite looping, high cpu, and more problems.

Solution: Use a ConcurrentHashMap or synchronize access to their HashMap.

In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.