How to compile vtk for memory profiling

That’s good to know. I was about to suggest you to compile Python with about the same configuration you used to build VTK and your program.