Which of the following statements about Python memory management is correct?

Options

  • A. Python uses only manual memory allocation
  • B. Python uses automatic memory management and garbage collection
  • C. Python does not allocate memory for objects
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. Python uses automatic memory management and garbage collection

Detailed Explanation

Python manages memory automatically. In CPython, reference counting and cyclic garbage collection are important mechanisms.