I am baffled a bit after my findings during the Memory Analysis tests ran on my application. The problem is the same old memory leak problem. Following is the scenario:
Firstly I have a singleton class which is registerd with ApacheMQ JMS server as message Listener. Now, I check for the status of the ApacheMQ Server. If it goes down I finalize the singleton class and again when it goes up I reinitialize the singleton class. I also have a singleton class acting as a producer for the same server and I finalize and reinitialize it when it goes down and again up respectively.
The problem is that while the Producer singleton class is Garbage Collected, The Singleton Class implementing MessageListener interface does not get Garbage Collected. I have checked the call Hierarchy within Eclipse as well as with Jprofiler that I am not maintaining any references to that class after finilazing it., still it does not get Garbage Collected.
Can anybody provide me explanation for this or tell me what to do so that it is garbage collected.