Tried to limit mem usage in python script