The Cougaar memory profiler is a tool for debugging memory usage and leaks in any Java application. It features a scalable 100% Java design that is lighter weight than existing JVMPI-based profilers (hprof, OptimizeIt(tm), JProbe(tm), etc).
Memory leaks can arise in Java applications due to unintentional object references. For example, an application may fail to remove callback listeners or close streams, preventing these objects from being garbage collected. Even minor leaks can grow to major problems in deployed systems.
The profiler tracks memory usage within the application by using tables of WeakReferences. The developer selects which classes should be tracked and runs an automated classfile editor (using BCEL) to add profiling instructions to the constructors.