2 Replies Latest reply on Jan 7, 2016 3:47 AM by Timothy Tong

    Instances Not GCed when Cache is removed from Cache Manager

    Timothy Tong Newbie

      This is on Infinispan 7.2.4.Final.

       

      After I stopped an existing local cache and removed it from the cache manager, I noticed that the cache and all other objects associated with the cache are not being garbage collected.

       

      cache.stop();
      cacheManager.removeCache(cache.getName());
      


      If you look at the image below, you'll notice that the CacheManager is holding onto a listener (NumericVersionGenerator$RankCalculator) which in turn is holding onto the cache. Because of this reference, none of the cache related entities become eligible to be garbage collected. We continue to create a new cache per user session so our memory consumption grows until we simply run out. It is a little odd for the cache manager to be holding onto a listener for a cache that the manager no longer holds.

      Capture.PNG

       

      Am I missing something in regards to properly stopping and removing a cache from the manager?