Profiling memory usage of Python code