What is the "Service Thread" in the JVM

Viewed 321

When I run the jstack command, I can see a thread named "Service Thread". What is it, and what does it do?

1 Answers

The thread with the name "Service Thread" is an internal thread to the JVM that is implemented in the JVM native code. It waits for notifications for certain internal events and then processes them. According to the OpenJDK Java 11 source code, these are:

  • low memory events
  • deferred JVMTI events
  • GC notifications
  • JMX Dcmd notifications and
  • String table work items.

I can't tell you what those events all mean. If you really want (or need) to know, read the OpenJDK source code for yourself. Otherwise, it is safe to ignore this thread.

Related