HOME/Articles/

python code find memory used by obj (snippet)

Article Outline

Python example 'python code find memory used by obj'

Modules used in program:

  • import sys

python code find memory used by obj

Python code example: python code find memory used by obj


#Find memory used by an object

import sys
print(sys.getsizeof(6))

More Python: https://pythonprogramminglanguage.com