what is RMI TCP connection in Visual VM
Asked Answered
H

3

28

I'm making a desktop application in java and am doing some memory optimisations. That made me come across two threads running in the JVM, both named:

RMI TCP connection

And they're both contributing to heap growth quite considerably (at my perspective)

Now I don't know much, but TCP sounds to me like it's some internet thing. From what I've managed to find on google, it has something to do with serialization/deserialization over the internet.

But my application doesn't need the internet, so I would like to know two things:

  1. what are they and what are they doing in my JVM?
  2. Can I get rid of them somehow?

enter image description here

My tool has been "Java visualVM". A though has crossed my mind that the two threads are spawned as a result of using this tool, in which case I'll feel a bit stupid.

Hilmahilt answered 24/11, 2016 at 19:41 Comment(2)
You are correct. They are spawned as a result of using this tool.Bonham
great, thanks. Correct and stupid. I would mark this as an answer if I could.Hilmahilt
T
21

The threads are used to feed a remote JMX client (in your case Java VisualVM) with data from your JVM.

Once you disconnect the threads should not allocate so much data anymore.

To verify this you can go to the Threads tab and look at the thread dump of a RMI TCP Connection thread. You should see that the RMI operations trigger JMX beans.

Tzar answered 26/7, 2017 at 17:14 Comment(0)
M
2

RMI is a Java API, which allows you to divide the implementation of parts of the same application on multiple computers. Do you use java.rmi library in your project?

Marilynnmarimba answered 24/11, 2016 at 20:8 Comment(3)
Nope , I am using the lwjgl 3.0 framework though. Could be that they do it. I will check on their forum.Hilmahilt
Can't find any references to RMI in their sourceHilmahilt
In google, I found some messages about rmi exceptions when using the lwjgl library. Apparently, while working with native C library for some reason Java use rmi connection or something like that.Marilynnmarimba
E
0

The RMI TCP Connection handles the serialization and deserialization of objects, method invocation requests, and responses between the client and server. It provides a transparent and remote method invocation mechanism, allowing Java objects to be accessed and manipulated remotely.

It is responsible for establishing and managing the network connection, sending requests from the client to the server, and receiving and processing the responses from the server.

Emphysema answered 26/5, 2023 at 8:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.