I want to know the memory usage of my Python application and specifically want to know what code blocks/portions or objects are consuming most memory. Google search shows a commercial one is Python Memory Validator (Windows only).
And open source ones are PySizer and Heapy.
I haven't tried anyone, so I wanted to know which one is the best considering:
Gives most details.
I have to do least or no changes to my code.
Muppy is (yet another) Memory Usage Profiler for Python. The focus of this toolset is laid on the identification of memory leaks.
Muppy tries to help developers to identity memory leaks of Python applications. It enables the tracking of memory usage during runtime and the identification of objects which are leaking. Additionally, tools are provided which allow to locate the source of not released objects.
Try also the pytracemalloc project which provides the memory usage per Python line number.
EDIT (2014/04): It now has a Qt GUI to analyze snapshots.