incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Au <>
Subject Best way to fix JMX threads leak in NodeProbe
Date Tue, 26 Oct 2010 16:14:02 GMT
I have discovered a JMX threads leak in NodeProbe.  Here is the original
email thread on the user mailing list:

NodePorbe creats a JMXConnector but never calls JMXConnector.close().  The
use of a JMXConnector in NodeProbe is not exposed in its API.  So without
changing the API, my initial thought is to add a finalize() method to
NodeProbe in which JMXConnector.close() is called.  But I am not sure if
this is the best solution.  Using a finalizer many lead to memory leak since
in this case NodeProbe will not be garbage collector until its finalizer is
called, but in Java the finalize() method is not guaranteed to be called at
any particular time.  We probably don't want to create a new JMXConnector
for each operation.  Should we add a close() method to NodeProbe which users
of NodeProbe has to call to avoid using a finalizer?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message