Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

In our application remote Procedure call is solved with an own netty based command dispatcher 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 spawns about 17 threads for each JVM. I do not need RMI at all (as far as I know).

Can I completely disable RMI for a jvm? Or at least configure it in a way that it does not use this many threads?

like image 342
Sobvan Avatar asked Oct 23 '25 14:10

Sobvan


1 Answers

You are most likely looking at your JVMs with a monitoring application, right? Well: these monitoring applications use RMI. So you will see always RMI threads within your monitoring application, profiler, etc. And you will always see them using some amount of CPU time. Just as gathering profiling information does not work without transporting these information (via RMI) to your tool. You can implement your own transportation protocol and direct the management beans to use it but I doubt that you can save enough resources to return your development costs.

If you don’t use any RMI, RMI won’t start any threads. But if you are using it, even if you aren’t aware of this, disabling RMI implies that your software will not work any more.

like image 57
Holger Avatar answered Oct 25 '25 07:10

Holger