Tuesday, June 22, 2021

Python⇒Speed: Measuring memory usage in Python: it's tricky!

If you want your program to use less memory, you will need to measure memory usage. You’ll want to measure the current usage, and then you’ll need to ensure it’s using less memory once you make some improvements.

It turns out, however, that measuring memory usage isn’t as straightforward as you’d think. Even with a highly simplified model of how memory works, different measurements are useful in different situations.

In this article you’ll learn:

  • A simplified but informative model of how memory works.
  • Two measures of memory–resident memory and allocated memory–and how to measure them in Python.
  • The tradeoffs between the two.
Read more...

from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...