How to check the memory usage of objects by python
This article will explain in detail how python checks the memory footprint of objects. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Check the memory usage of an object
Sys.getsizeof () function
Import sysstr1 = "123456" print (sys.getsizeof (str1)) # output what 55python libraries are commonly used by python: 1.requesutswitt. 2.scrapyThere are commonly used libraries in python: 1.requesutsThere are 4.twistestants5.numpyThere are 6.matplotlibters7.pygamaShift 8.ipyhton and so on.
This is the end of this article on "how to check the memory footprint of objects in python". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.