Class InstanceTracker

java.lang.Object
net.sf.colossus.util.InstanceTracker

public class InstanceTracker extends Object
Objects can register here when they are created. This class notices when it an object is garbage collected and keeps then track which instances are still running/alive. One can configure for which classes one is interested in seeing the created/removed delta. This is meant for debug/development purposes, to verify that cleanup is usually done properly, and not threads or objects stay unintentionally referenced and never get garbage collected. So while editing/testing, one sets the "which one to see" to the ones one want to monitor, but in productive use, i.e. when checked in to svn, this should be set to "don't show anything". (perhaps with Java 1.5 or 1.6, or a good debugger one can achieve the same effect, but I don't know how ;-)
Author:
Clemens Katzer
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • instanceGroups

      private static Map<String,InstanceGroup> instanceGroups
    • interestedIn

      private static Set<String> interestedIn
    • interestedInAll

      private static boolean interestedInAll
    • ignoreDummyFrame

      private static boolean ignoreDummyFrame
  • Constructor Details

    • InstanceTracker

      public InstanceTracker()
  • Method Details

    • register

      public static void register(Object o, String id)
    • setId

      public static void setId(Object o, String id)
    • printStatistics

      public static void printStatistics()
    • getPrintStatistics

      private static String getPrintStatistics()
    • allGone

      public static boolean allGone()