Provides a tool for debugging memory leaks.
On first load, the total memory being used by Python is displayed, as well as the objects which use the most memory - how many of those objects exist in memory, and how much memory each uses. On each subsequent reload, the information will be displayed along with a difference from the last time a page was loaded - which objects have been created since the last page load, and how much memory usage has increased.
The total memory figure does not include memory taken by external modules such as database drivers. This accounts for the figure being lower than the total memory used by the j5 the application.
In addition to the informational tables, graphs can be generated to more closely examine the usage of a class that appears to be using excessive memory. These graphs can be generated in dot or png format. Dot format, viewable with a program such as xdot, can be easier to read if there are many relationships.
The 2 types of graphs that can be generated are:
Full referrers from random object: This chooses one instance of the selected class at random and maps all objects which hold a reference to it, and all objects which hold a reference to those objects, until there are no more references.
Limited referrers from all objects: This maps objects with references to all the instances of the selected object, but only go back three referrers when tracing back references to referrers.
Since Python’s garbage collection cleans up memory for objects which are not being held, these graphs can help track down what is holding references to objects when it should not be, thus causing the leak.
The relationship graphs require the objgraph library.