| 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: 126
|
|
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: 288
|
|
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: 4422
|
|
@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: 126
|
|
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..
|
 |
 |
|
|
subject: is there a way to free the RMI object after calling the remote method?
|
|
|