• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Memory Leak Problem

Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
Saloon Keeper
Posts: 24283
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic