ATLAS Offline Software
Functions | Variables
python.utils.AtlRunQueryMemUtil Namespace Reference

Functions

def _VmB (VmKey)
 
def memory (since=0.0)
 
def resident (since=0.0)
 
def stacksize (since=0.0)
 

Variables

string _proc_status = '/proc/%d/status' % os.getpid()
 
dictionary _scale
 

Function Documentation

◆ _VmB()

def python.utils.AtlRunQueryMemUtil._VmB (   VmKey)
private
Private.

Definition at line 10 of file AtlRunQueryMemUtil.py.

10 def _VmB(VmKey):
11  '''Private.
12  '''
13  global _proc_status, _scale
14  # get pseudo file /proc/<pid>/status
15  try:
16  t = open(_proc_status)
17  v = t.read()
18  t.close()
19  except (OSError,ValueError):
20  return 0.0 # non-Linux?
21  # get VmKey line e.g. 'VmRSS: 9999 kB\n ...'
22  i = v.index(VmKey)
23  v = v[i:].split(None, 3) # whitespace
24  if len(v) < 3:
25  return 0.0 # invalid format?
26  # convert Vm value to bytes
27  return float(v[1]) * _scale[v[2]]
28 
29 

◆ memory()

def python.utils.AtlRunQueryMemUtil.memory (   since = 0.0)
Return memory usage in bytes.

Definition at line 30 of file AtlRunQueryMemUtil.py.

30 def memory(since=0.0):
31  '''Return memory usage in bytes.
32  '''
33  return _VmB('VmSize:') - since
34 
35 

◆ resident()

def python.utils.AtlRunQueryMemUtil.resident (   since = 0.0)
Return resident memory usage in bytes.

Definition at line 36 of file AtlRunQueryMemUtil.py.

36 def resident(since=0.0):
37  '''Return resident memory usage in bytes.
38  '''
39  return _VmB('VmRSS:') - since
40 
41 

◆ stacksize()

def python.utils.AtlRunQueryMemUtil.stacksize (   since = 0.0)
Return stack size in bytes.

Definition at line 42 of file AtlRunQueryMemUtil.py.

42 def stacksize(since=0.0):
43  '''Return stack size in bytes.
44  '''
45  return _VmB('VmStk:') - since

Variable Documentation

◆ _proc_status

string python.utils.AtlRunQueryMemUtil._proc_status = '/proc/%d/status' % os.getpid()
private

Definition at line 5 of file AtlRunQueryMemUtil.py.

◆ _scale

dictionary python.utils.AtlRunQueryMemUtil._scale
private
Initial value:
1 = {'kB': 1024.0, 'mB': 1024.0*1024.0,
2  'KB': 1024.0, 'MB': 1024.0*1024.0}

Definition at line 7 of file AtlRunQueryMemUtil.py.

python.utils.AtlRunQueryMemUtil.stacksize
def stacksize(since=0.0)
Definition: AtlRunQueryMemUtil.py:42
python.utils.AtlRunQueryMemUtil.memory
def memory(since=0.0)
Definition: AtlRunQueryMemUtil.py:30
python.utils.AtlRunQueryMemUtil.resident
def resident(since=0.0)
Definition: AtlRunQueryMemUtil.py:36
python.utils.AtlRunQueryMemUtil._VmB
def _VmB(VmKey)
Definition: AtlRunQueryMemUtil.py:10
Trk::open
@ open
Definition: BinningType.h:40
readCCLHist.float
float
Definition: readCCLHist.py:83
Trk::split
@ split
Definition: LayerMaterialProperties.h:38