def _VmB(VmKey):
    global _proc_status, _scale
    # get pseudo file  /proc/<pid>/status
    try:
        with open(_proc_status) as t:
            v = t.read()
    except:
        return 0.0  # non-Linux?
    # get VmKey line e.g. 'VmRSS:  9999  kB\n ...'
    i = v.index(VmKey)
    v = v[i:].split(None, 3)  # whitespace
    if len(v) < 3:
        return 0.0  # invalid format?
    # convert Vm value to bytes
    return float(v[1]) * _scale[v[2]]
dataset/ETHPy150Open androguard/androguard/demos/benchmark.py/_VmB/original