Multiple threads running


Monitoring a server that was slow, I came across more than 40 threads similar to those in the screenshot below. I don’t understand why they are running.

Could anyone help to understand?

Your server is spinning up a lot of client connections, that appear to be busy-waiting for data to be parsed on it.

The pattern isn’t necessarily bad, but it is surprising that your server is establishing client connections (using Smack). What plugins are installed in Openfire?

Just these two

I don’t understand why either. This server is simply starting to have slow problems and now monitoring with VisualVM I have identified many of these threads running.

Neither of those plugins include Smack, as far as I know.

This is super weird, to the point where I’m starting to think you maybe profiled the wrong process? Is there anything else on that same server that maybe is using Smack?

We used some Java functions from a third party that connects to Openfire via TCP and I noticed that in the code there is use of objects for the org.jivesoftware.smack package, it could be from there then.

Does this refer to multiple client connections to Openfire?

Then I believe that this third party Java function is the process that you profiled, not Openfire itself.

Maybe take a step back, to see if we’re actually looking at the right thing?

It’s probably this JAR.

What are the ways for an web application to communicate with Openfire to perform certain actions?

I’m not sure what you mean by ‘this JAR’.

A web application would typically interact with Openfire using one of the Javascript XMPP libraries that are provided by third parties. Have a look at XMPP | XMPP Software for an overview of what’s available.

The JAR I referred to is the library of the Java project I’m working on, where this JAR uses the org.jivesoftware.smack package.

I’ll try to analyze it better and understand why it generated these multiple threads. It is not frequent but it occurred during monitoring.

Thank you very much!