You need to sychronize or guard your access to the TreeMap or switch to ConcurrentMap. Multiple threads have concurrently modified your tree map, creating a cycle in the tree map. When your code accesses the tree map again it get stuck in a cycle. Read more about the problem in these 3 great articles: