def get_mem_usage(filename):
    with open(filename) as file:
        contents = file.readlines()
    memory_points = []
    for index in range(len(contents)):
        if ('snapshot' in contents[index]):
            emptyLine = contents[(index + 1)]
            time = contents[(index + 2)]
            mem_heap = contents[(index + 3)]
            mem_heap_extra = contents[(index + 4)]
            mem_stacks = contents[(index + 5)]
            heap_tree = contents[(index + 6)]
            memory_points.append(MemPoint(time, mem_heap, mem_heap_extra, mem_stacks, heap_tree))
    maxUsage = max((value.get_sum_memusage() for value in memory_points))
    return maxUsage
def get_mem_usage(filename):
    with open(filename) as file:
        contents = file.readlines()
    memory_points = []
    for index in range(len(contents)):
        if ('snapshot' in contents[index]):
            emptyLine = contents[(index + 1)]
            time = contents[(index + 2)]
            mem_heap = contents[(index + 3)]
            mem_heap_extra = contents[(index + 4)]
            mem_stacks = contents[(index + 5)]
            heap_tree = contents[(index + 6)]
            memory_points.append(MemPoint(time, mem_heap, mem_heap_extra, mem_stacks, heap_tree))
    maxUsage = max((value.get_sum_memusage() for value in memory_points))
    return maxUsage