Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
s ravi chandran
Ranch Hand
Posts: 346
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 291
Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@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
Posts: 346
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic