Yes, we should add a close method.
On Oct 26, 2010 9:14 AM, "Bill Au" <bill.w...@gmail.com> wrote:
> I have discovered a JMX threads leak in NodeProbe. Here is the original
> email thread on the user mailing list:
>
> http://www.mail-archive.com/u...@cassandra.apache.org/msg06764.html
>
> 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?
>
> Bill

Reply via email to