Performance - Memory Usage - j5 - 28.0 - Installation & Upgrade - Hexagon

j5 Installation and Upgrade

Language
English
Product
j5
Search by Category
Installation & Upgrade
j5 Version
2019

The Performance - Memory Usage page 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 object uses. On each subsequent reload, the information is displayed along with a difference from the last time the page was loaded - which objects have been created since the last page load, and by 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 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 two 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.