Python Memory Validator

Python Memory Validator is a memory leak detection software tool for use by software developers, software quality assurance testers and customer support staff using Python 2.2.

Use Python Memory Validator to:

  • Monitor billions of allocations in your application.
  • Examine memory allocation trends.
  • Detect memory leaks.
  • Command line API to support automated use (Jenkins, etc).
  • Run regression tests to find memory leaks in your overnight builds.

2 Minute Video

Find memory leaks quickly and easily with Python Memory Validator.

7 step python memory leak detection

To use Python Memory Validator all you need is your python program. You do not need to modify your software to use Python Memory Validator.

  1. Launch your application with Python Memory Validator.
  2. Run your application as normal.
  3. Create snapshots at appropriate points in your application execution.
  4. Close your application.
  5. Examine the memory allocation trends shown on the Allocations, Objects, Generations and Ages displays.
  6. Find datatypes that grow but don’t shrink.
  7. Compare snapshots to identify memory leaks.

Python Memory Validator snapshot

Drill down to the data in the displays by expanding an entry in the display to display information about the memory leak: What type of object was allocated, what size, where (address, filename, line number<), thread id, allocation timestamp, lifetime and sequence id. Also displayed is a comprehensive callstack showing each class and method name, filename and line number. Each entry can be expanded to display the source code for that line.

Python Memory Validator callstack

Python Memory Validator source code detail

Configurable

Python Memory Validator can be configured to collect all data or just the data you need. Powerful filters for collecting data and for displaying collected data give you maximum flexibility and control over how much CPU time is spent and how much memory is used collecting data allowing you to choose how much effort is put into a given task.

HTML and XML export

Python Memory Validator provides powerful HTML and XML reporting capabilities, allowing you to produce overnight leak reports as part of your regression testing strategy.

Compatible

Python Memory Validator works with 32-bit Python versions from 2.2 to 2.7.

Regression test support

As well as the traditional interactive memory leak debugging role, Python Memory Validator can be used to compare two recorded sessions to show the difference between the sessions. This allows you to determine if changes to your code have resulted in improvements (fewer memory leaks) or regressions (more memory leaks).

Command Line

Python Memory Validator also allows you to automate memory leak testing by launching from the command line.

A full range of command line options allows you to perform unattended runs of Python Memory Validator, complete with HTML export and XML export, to facilitate regression testing as part of your overnight builds.

Example 1 Launch a program with a specific startup directory, using two arguments, and save the session without showing the Python Memory Validator interface.

pMemoryValidator.exe -hideUI
                     -program c:\myProgram.py
                     -directory c:\testbed
                     -arg " -macro c:\macros\testMacro1.vba"
                     -arg "secondArg"
                     -saveSession c:\results\testMacro1.pmvm

Example 2 Launch a program with a specific startup directory, using two arguments, save the session, compare the recorded session with a known baseline and export the comparison results to HTML and XML. The Python Memory Validator interface is not shown.

pMemoryValidator.exe -hideUI
                     -program c:\myProgram.py
                     -directory c:\testbed
                     -arg " -macro c:\macros\testMacro1.vba"
                     -arg "secondArg"
                     -saveSession c:\results\testMacro1.pmvm
                     -baseline c:\baselines\testMacroBaseline.pmvm
                     -sessionCompareHTML c:\regression\testMacro1.html
                     -sessionCompareXML c:\regression\testMacro1.xml

Software Updates

Sorry, there are no software updates for Python Memory Validator.

Legacy Software

This is the last version of Python Memory Validator we released in 2014.

  1. The automatic configuration of Python Memory Validator does not work because of changes to Windows since 2014. You will need to configure the Python runtime manually. Do this by following the instructions in the video at the top of this page.
  2. Our software codebase has changed quite a bit since 2014. Reaching the point where we can build a modern version of Python Memory Validator will take some work. At that point we can consider software updates.
  3. There is no online documentation. Documentation is in Windows Help format (.chm) and is downloaded with the software.

Fully functional, free for 30 days