File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes is there a way to free the RMI object after calling the remote method? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "is there a way to free the RMI object after calling the remote method?" Watch "is there a way to free the RMI object after calling the remote method?" New topic
Author

is there a way to free the RMI object after calling the remote method?

s ravi chandran
Ranch Hand

Joined: Dec 20, 2010
Posts: 149
hi,

i have an RMI application using simple rmi call, just passing few params to server and everything is looking fine. recently i was running it in eclipse in debug mode and i saw a strange thing. whenever i was calling this remote method, a new thread was being created, named "Selector Thread". Now i know that i am not creating it, and i just don't know how to stop it from being created. I am using a single global RMI object, there is no multiple remote interface object creation, it is just the call. is this normal?

is there a way to stop new threads from being created or the old one to simply stop or destroy itself?

thanks
Edward Harned
Ranch Hand

Joined: Sep 19, 2005
Posts: 291

RMI Servers handle multiple requests concurrently. The way it is done is with threads. Each new request runs in either a new thread, or it re-uses an existing thread. The RMI Runtime will destroy old threads after awhile.

There is a lot of information on exactly how this works on the internet. Just search.


Ed's latest article: A Java Parallel Calamity http://coopsoft.com/ar/Calamity2Article.html
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4637
    
    5

@ravi, why do you think this is a problem?

I assume you are using RMI for a school project and not for something real. RMI is a bad protocol, and should not be used for modern production programs.
s ravi chandran
Ranch Hand

Joined: Dec 20, 2010
Posts: 149
Pat Farrell wrote:@ravi, why do you think this is a problem?

I assume you are using RMI for a school project and not for something real. RMI is a bad protocol, and should not be used for modern production programs.


well, unfortunately, it is part of an antique production software. I have to use RMI as their complete software is working on RMI. the issue is from the testing team, they are bugging me asking about this additional threads. I don't see this threads impacting the performance of my application, but they don't believe me..

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is there a way to free the RMI object after calling the remote method?
 
Similar Threads
Threads problem.
Server-side threads in Java RMI
Multithreading a request in the server
threads in a distributed application
RMI Server