import random import sys from memory_profiler import profile size = 100 if len(sys.argv) > 1: size = int(sys.argv[1]) @profile(precision=10) def fill_row(): data_row = [] for i in range(size): data_row.append(random.random()) return data_row data = [] for i in range(size): data_row = fill_row() data.append(data_row) #print(data)