Is there a way to completely disable RMI in a Java application?

In our application, remote procedure call is resolved using its own netty-based dispatch system. We have a lot of modules (about 20) and I want to run all modules in separate jvm-s. My problem is that RMI generates about 17 threads for each JVM. I don't need RMI at all (as far as I know).

Is it possible to completely disable RMI for jvm? Or at least set it up so that it doesn't use many threads?

+2


source to share


2 answers


StewartMarks is faithful . RMI doesn't start a thread until you use it.



You may be using it in some way that you are not aware of, for example. JMX?

+3


source


You are most likely looking at your JVMs with a monitoring application, right? Good: these monitoring applications use RMI. This way you will always see RMI streams in your monitoring application, profiler, etc. And you will always see that they are using a certain amount of CPU time. Just like collecting profiling information doesn't work without passing that information (via RMI) to your tool. You can implement your own transport protocol and route the beans to use it, but I doubt you can save enough resources to recoup your development costs.



If you are not using any RMI, RMI will not start any threads. But if you use it, even if you don't know about it, turning off RMI means your software will no longer work.

+4


source







All Articles