How to troubleshoot the increase of python memory usage

1. Create a global variable , such as a list or dict type, which has been stuffed with data and has not been released; create a class variable, the class only creates an instance once, and infinitely stuffs data into the class variable. Let's first check the global variable and class variable queue
2
. Whether to create variables repeatedly when importing packages or variables.
Especially when importing packages, be sure to addif __name__ == '__main__':

Guess you like

Origin blog.csdn.net/qq_16792139/article/details/131803721