I have a Tomcat 9.0.60 Server running on OpenJDK 1.8.0 on Linux where a netstat -ltpn|grep java
shows that it listens to more than the configured ports:
tcp 0 0 0.0.0.0:37917 0.0.0.0:* LISTEN 50384/java
tcp 0 0 10.100.0.188:39780 0.0.0.0:* LISTEN 50384/java
tcp 0 0 10.100.0.188:41415 0.0.0.0:* LISTEN 50384/java
tcp 0 0 0.0.0.0:34476 0.0.0.0:* LISTEN 51139/java
(I removed all the configured ports from that list.)
So I think that several applications also opened "their own" sockets they listen to. I want to find out for each port, which of the Java threads is listening to, so I can then further find out the application and maybe if it is still required or just a leftover one of the devs forgot.
So far I tried to find out things with the VisualVM via a JMX connection, but did not get very far - probably because I'm not experienced enough.
Can you give me any hints - or maybe a complete solution - how I can find out the port to thread mapping please?
I don't need to automate this, it's more of a once-in-a-while manual job for documentation and checking.