00001 // @(#)root/memstat:$Name$:$Id: run_test.C 143 2008-06-17 16:15:42Z anar $ 00002 // Author: Anar Manafov (A.Manafov@gsi.de) 28/04/2008 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 ////////////////////////////////////////////////////////////////////////// 00013 // // 00014 // This is a simple demo of TMemStat. // 00015 // // 00016 // Usage: // 00017 // root [0] .x MemStat.C // 00018 // // 00019 // This subroutine calls the "MemStatLeak.C" script, which produces a // 00020 // data file with all collected memory-wise information. // 00021 // Then the TMemStat object is created and a report is called. // 00022 // The report will show all detected memory allocations according to // 00023 // stack traces. // 00024 // At the end the TMemStat GUI is called. // 00025 // // 00026 // This script works ONLY on Linux for the time being // 00027 // // 00028 ////////////////////////////////////////////////////////////////////////// 00029 00030 void MemStat() 00031 { 00032 // calling a "leaker" 00033 gROOT->Macro("MemStatLeak.C+"); 00034 // Creating the TMemStat object in "read" mode 00035 TMemStat mem; 00036 // Printing a report 00037 mem.Report(); 00038 // a GUI of TMemStat 00039 TMemStatViewerGUI::ShowGUI(); 00040 }