Ignore:
Timestamp:
03/29/05 09:56:16 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r6513 r6890  
    263263
    264264    return kTRUE;
     265}
     266
     267// --------------------------------------------------------------------------
     268//
     269// Return the memory currently used by this process (VmSize)
     270// which contains shared memory, data memory and private memory.
     271//
     272UInt_t MEvtLoop::GetMemoryUsage()
     273{
     274    const TString path = Form("/proc/%d/status", gSystem->GetPid());
     275    if (gSystem->AccessPathName(path, kFileExists))
     276        return 0;
     277
     278    return TEnv(path).GetValue("VmSize", 0);
    265279}
    266280
     
    400414        return kFALSE;
    401415
     416    const UInt_t mem0 = GetMemoryUsage();
     417
    402418    //
    403419    //   loop over all events and process all tasks for
     
    514530    if (numcnts>0)
    515531        *fLog << " --> " << numcnts/clock.RealTime() << " Events/s";
     532
     533
     534    const UInt_t mem1 = GetMemoryUsage();
     535    if (mem1>mem0)
     536        *fLog << endl << "Mem  - Loss: " << mem1-mem0 << "kB" << endl;
    516537
    517538    *fLog << endl << endl;
Note: See TracChangeset for help on using the changeset viewer.