3

I am instrumenting a Restful Java microservice with JProfiler while I send multiple requests with JMeter. I see that there are a lot of blocked threads. The microservice use Spring, SpringBoot. When multiple requests are sent, somehow the problems appears.

In JProfiler tool, I can see: Overview Thread History Monitor Usage Monitor History Thread Dump

  • After I read: Circular Deadlock, Dining philosophers, I think there is a Circular Deadlock. Is this right?
  • What is the difference between Deadlock and Circular Deadlock? After I navigated a bit on internet, I see another concept, Circular Wait. What about Circular Wait?
  • If you look on Monitor History and Overview sections, you see a lot of blocked threads, also a thread waits for other thread to finish. The problem is with ReentrantLock.NonfairSync class. But if you look on Thread Dump, you see the threads are in the Waiting state and on the top of stacktrace you see sun.misc.Unsafe.park. With methods park and unpark it is realized the Thread Locks. Do you know what it can be?
  • Could be a problem with com.fasterxml library again? jackson project

Thank you

Stephen Docy
  • 4,738
  • 7
  • 18
  • 31
Adrian
  • 395
  • 3
  • 13

1 Answers1

0

After I read: Circular Deadlock, Dining philosophers, I think there is a Circular Deadlock. Is this right?

It is not possible to say based on the evidence.

What is the difference between Deadlock and Circular Deadlock?

I've never seen the term circular deadlock before, but in the context of that article, "circular" seems to mean that there are more than two threads deadlocked. It is not a particularly useful distinction to make, in my opinion.

After I navigated a bit on internet, I see another concept, Circular Wait. What about Circular Wait?

I found this term in the Wikipedia Deadlock page. In that context, it refers to any situation where you have N agents (e.g. threads) A1 through AN and:

  • A1 waits for A2
  • A2 waits for A3
  • ...
  • AN waits for A1

making a "circle" or loop in the dependencies. Note that N can be as small as 2. (This is explained clearly in the Wikipedia page.)

With methods park and unpark it is realized the Thread Locks. Do you know what it can be?

That is just how locks and waiting are implemented in a JVM.

Could be a problem with com.fasterxml.jackson library again?

That is possible. It is also possible that there is a problem with the way that you are using the library. However this is speculation. There is insufficient evidence to say what the problem is from the information you have provided.


I advise you to stop searching for answers. Instead, put on your thinking hat, and start reading the code and the javadocs.

If I was to guess, it would be that you have multiple threads trying to share an XML parser object of some kind, where the object is not designed to be shared.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216