I have an enterprise application which was eating so much of CPU. As dug further into thread dump, I see the threads that are eating so much CPU is stuck at TreeMap.put
. I see a similar question here due to the same problem.
I understand people mentioned there that TreeMap is not thread safe. But what I don't understand is, not having ThreadSafe might cause inconsistent results. But why it holds the CPU?