• Post Reply Bookmark Topic Watch Topic
  • New Topic

Memory Leak Problem  RSS feed

 
Jigs Mehta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

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.

Thanks in advance to all for helping!!
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If an object truly has no references, it's eligible for garbage collection. As long as even one reference remains, it cannot be collected. So somewhere, evidently, you have a hanging reference(s).

An hprof dump might help you.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!