Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is RMI TCP connection

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.

like image 557
Jake Avatar asked Nov 24 '16 19:11

Jake


People also ask

What is RMI TCP?

RMI is a Java API, which allows you to divide the implementation of parts of the same application on multiple computers.

What is RMI connection?

RMI stands for Remote Method Invocation. It is a mechanism that allows an object residing in one system (JVM) to access/invoke an object running on another JVM. RMI is used to build distributed applications; it provides remote communication between Java programs. It is provided in the package java. rmi.

Does RMI use TCP?

On top of the TCP/IP layer, RMI uses a wire-level protocol called Java Remote Method Protocol (JRMP), which works like this: Objects that require remote behavior should extend the RemoteObject class, typically through the UnicastRemoteObject subclass.

What is RMI scheduler?

Regional Medical Imaging offers an online scheduling portal. Physicians may efficiently schedule and manage their patient's RMI appointments. The portal also shows their real-time scheduling status. Patients can also book directly with links found on the RMI website.


2 Answers

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.

like image 83
Gregor Koukkoullis Avatar answered Sep 29 '22 06:09

Gregor Koukkoullis


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?

like image 36
NetL Avatar answered Sep 29 '22 06:09

NetL