jtop/core/tegra_parse.py
def RAM(text):
    """
        RAM X/Y (lfb NxZ)
        Largest Free Block (lfb) is a statistic about the memory allocator.
        It refers to the largest contiguous block of physical memory
        that can currently be allocated: at most 4 MB.
        It can become smaller with memory fragmentation.
        The physical allocations in virtual memory can be bigger.
        X = Amount of RAM in use in MB.
        Y = Total amount of RAM available for applications.
        N = The number of free blocks of this size.
        Z = is the size of the largest free block.
    """
    match = RAM_RE.search(text)
    if match:
        return {'use': int(match.group(1)),
                'tot': int(match.group(2)),
                'unit': str(match.group(3)),
                # group 4 is an optional space
                'lfb': {'nblock': int(match.group(5)),
                        'size': int(match.group(6)),
                        'unit': str(match.group(7))}
                }
    else:
        return {}

        RAM X/Y (lfb NxZ)
        Largest Free Block (lfb) is a statistic about the memory allocator.
        It refers to the largest contiguous block of physical memory
        that can currently be allocated: at most 4 MB.
        It can become smaller with memory fragmentation.
        The physical allocations in virtual memory can be bigger.
        X = Amount of RAM in use in MB.
        Y = Total amount of RAM available for applications.
        N = The number of free blocks of this size.
        Z = is the size of the largest free block.
    
RAM X/Y (lfb NxZ)
Largest Free Block (lfb) is a statistic about the memory allocator.
It refers to the largest contiguous block of physical memory
that can currently be allocated: at most 4 MB.
It can become smaller with memory fragmentation.
The physical allocations in virtual memory can be bigger.
X = Amount of RAM in use in MB.
Y = Total amount of RAM available for applications.
N = The number of free blocks of this size.
Z = is the size of the largest free block.
RAM X / Y ( lfb NxZ ) Largest Free Block ( lfb ) is a statistic about the memory allocator . It refers to the largest contiguous block of physical memory that can currently be allocated : at most 4 MB . It can become smaller with memory fragmentation . The physical allocations in virtual memory can be bigger . X = Amount of RAM in use in MB . Y = Total amount of RAM available for applications . N = The number of free blocks of this size . Z = is the size of the largest free block .
def RAM(text):
    match = RAM_RE.search(text)
    if match:
        return {'use': int(match.group(1)),
                'tot': int(match.group(2)),
                'unit': str(match.group(3)),
                'lfb': {'nblock': int(match.group(5)),
                        'size': int(match.group(6)),
                        'unit': str(match.group(7))}
                }
    else:
        return {}
def RAM ( text ) : match = RAM_RE . search ( text ) if match : return { 'use' : int ( match . group ( 1 ) ) , 'tot' : int ( match . group ( 2 ) ) , 'unit' : str ( match . group ( 3 ) ) , 'lfb' : { 'nblock' : int ( match . group ( 5 ) ) , 'size' : int ( match . group ( 6 ) ) , 'unit' : str ( match . group ( 7 ) ) } } else : return { }
RAM X/Y (lfb NxZ)
Largest Free Block (lfb) is a statistic about the memory allocator.
RAM X / Y ( lfb NxZ ) Largest Free Block ( lfb ) is a statistic about the memory allocator .
"""
        RAM X/Y (lfb NxZ)
        Largest Free Block (lfb) is a statistic about the memory allocator.
        It refers to the largest contiguous block of physical memory
        that can currently be allocated: at most 4 MB.
        It can become smaller with memory fragmentation.
        The physical allocations in virtual memory can be bigger.
        X = Amount of RAM in use in MB.
        Y = Total amount of RAM available for applications.
        N = The number of free blocks of this size.
        Z = is the size of the largest free block.
    """ # group 4 is an optional space
text