MINOS Offline Documentation
[home] [installing MINOS software] [supported platforms] [package links] [mailing list] [HyperNews] [FAQ] [computing help] [MINOS glossary] [archives]

Leak Checkers

Valgrind is an open-source memory debugger. It can also be used to check for use of unitialised memory.

See WebDocs Valgrind for more info

The LeakChecker package is a very simple leak checker facility developed as part of the framework to provide the first level of defense against memory leaks. It can be used to allow basic leak checking to be built into package validation.

To use the checker, probes (C++ macro calls) are added to the code at each object creation and destruction. By default these macros generate nothing and so can safely be a permanent addition to the code. Activation is controlled by a preprocessor option which then generates calls to record object creation and destruction with a LeaLeakChecker object. This object can be used by validation code to query the number of objects created and the number currently active. The information can be supplied globally or for a specific class.

For more details see the Leak Checker chapter of the User Manual.

MemCheck is a leak checker built into ROOT. To use it you have to link in ROOT's libNew.so which replaces the standard new and delete operators. You run your application as normal but, on exit, it dumps a log of all new and delete operations which is then analysed by the ROOT utility memprobe. This looks for leaks and runs gdb on your application, to present the results as symbolic stack dumps so that you can not only see the leaking location but also the stack of callers that produced it. The checker can also be used when running macros directly from ROOT. It checks leaks of all classes; the objects don't have to inherit from TObject.

For more details see the MemCheck

ROOT's TObjectTable
To look for any objects that inherit from TObjects which could be clogging up memory:-
  1. In .rootrc (either in your home or current directory) add:-
       Root.MemCheck: 1
       Root.ObjectStat:  1
  2. At the end of the loon script (remembering to remove -q which forces loon to terminate at the end of the script), type:-
    This will list all the TObject-based objects currently in memory.

Insure++ is a commercial leak checker. We have a license to run it at FNAL. See our Tools Reviews page. We don't have much experience using it, so it's better to use one of the ones listed above.

Last Modified: $Date: 2006/06/01 09:53:24 $
Contact: n.west1@physics.ox.ac.uk
Page viewed from http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/leak_checkers.html
Security, Privacy, Legal Fermi National Accelerator Laboratory