I was attempting to instrument some of my Java code to ensure objects were being garbage collected correctly, and I found that surprisingly it wasn't being called as often as I expected.
I am now wondering if this is because of faulty instrumentation or an actual memory leak I need to solve. the VisualVM profiler seems to indicate the former.
The situation of concern is that I have a thread which handles requests and inside the request creates thousands of temporary objects. Sometimes, the socket this thread writes to is unexpectedly closed and the thread hits an exception and dies.
When the Thread dies, it doesn't seem like .finalize() is ever called on those objects. Is this a reason to not trust my instrumentation?