• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to find a particular object is not used by any live thread.  RSS feed

 
Dhineshkumar raj
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In java is there any way to find a particular object is not used by any live thread.

Regards
Dhinesh
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dhineshkumar raj:
In java is there any way to find a particular object is not used by any live thread.

Regards
Dhinesh


You can use different type of references in java.lang.ref package and use a ReferenceQueue, in which the references will be queued when they are no longer reachable.
This article has a good explanation for these classes.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!